1
votes

I'm starting to do some work with the Orient 2.2 Beta release that is out to prep our project to utilize the new encryption functionality being included (http://orientdb.com/docs/last/Database-Encryption.html). I've seen the documents on how to create the connection to the database as a standard connection object, but I'm not seeing any way to pass the encryption key for connecting and using the OrientGraph/Factory java objects. Does anyone have any insight on how this works or if there's a way to set global config options with the OrientGraph/Factory java objects?

1

1 Answers

1
votes

You can connect to an encrypted database in the following way:- Set the database encryption information in the OGlobalConfiguration.

OGlobalConfiguration.STORAGE_ENCRYPTION_KEY.setValue("your_encryption_key");
OGlobalConfiguration.STORAGE_ENCRYPTION_METHOD.setValue("aes/des");

We can now get the access to the encrypted database using graph APIs.

OrientGraphFactory ogf = new OrientGraphFactory(url, username, password);
OrientTransactionalGraph og = ogf.getTx();

If you are using java 6, you also need to set the following property:-

OGlobalConfiguration.SECURITY_USER_PASSWORD_DEFAULT_ALGORITHM.setValue("PBKDF2WithHmacSHA1");

The default value for this property is 'PBKDF2WithHmacSHA256' which is available since java 7.