hsqldb: Encryption of an existing database?

℡╲_俬逩灬. 提交于 2019-12-11 17:30:28

问题


Do you know a method to encrypt an existing hsql database without loosing it contents?

I want to use it afterwards with the jdbc url

jdbc:hsqldb:file:<database path>;crypt_key=<key>;crypt_type=blowfish

回答1:


The only way to do this is by modifying the code and building a special jar that reads the .script in clear text, but does all the writing with encryption.

With the normal jar, execute SHUTDOWN SCRIPT on the existing database to turn it into a .script file.

Modify org.hsqldb.persist.Log#processScript() with Crypto crypto = null; instead of the existing line. Compile the jar using Ant or Gradle.

Open the database with the encryption URL the special jar and execute SHUTDOWN. This will encrypt the database

Use the normal jar to access the encrypted database.

As this is a useful feature, it may be added to future versions of HSQLDB.



来源:https://stackoverflow.com/questions/10681920/hsqldb-encryption-of-an-existing-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!