CipherDB Developer's Guide - Java
In this guide we will quickly cover how you can integrate CipherDB into your Java application.
Adding the Crypteron Agent via Maven
The first step in securing your data is adding the dependency for CipherDB to the pom.xml in your Maven project:
<dependency> <groupId>com.crypteron</groupId> <artifactId>cipherdb-agent-hibernate5</artifactId> <version>2016.8.1.1</version> </dependency>
Make sure to check back for new versions often since each new release gets even better!
Adding the App Secret to your application
After adding the dependency, let’s take a look at the changes to our persistence.xml. The first of these changes is the “appSecret,” which secures all communications with our API. Add the following property to your src/main/resources/META-INF/persistence.xml:
<persistence-unit> <properties> ... <property name="crypteron.appSecret" value=Replace_this_with_app_secret_from_https://my.crypteron.com /> ... </properties> </persistence-unit
To retrieve the app secret, go to my.crypteron.com and login to your account.
Once logged in, select the application you previously created and select the “Show” button next to “App Secret” to display the app secret. Next, copy the app secret to your clipboard and replace the placeholder value in the persistence.xml and save the changes.
Secure your data model
The final step in securing your data in your Java application will be to tell CipherDB which data to secure. In the event entity, simply add “@Secure” to any attribute to apply encryption. Finally, run the Maven Build for a clean install. Now, if you take a look at your database file in your filesystem, the attributes to which you added “@Secure” are now totally encrypted and appear as useless strings of data.
You've just secured your Java Application with CipherDB, bringing high-end data security to your entire application in minutes without spending months and years building and maintaining custom code. Feel free to contact us via support if you have any additional questions.