Setup PureKit
This guide is the first step to adding password-hardened encryption to your solution. Here you can learn how to set up PureKit at your backend to protect your users's passwords and data.
For more details about password-hardened encryption (PHE), take a look at our overview here.
Before you begin
Install PureKit
Use your package manager to install PureKit at your backend.
The PureKit Kotlin/Java is provided as a package named purekit
with group id named com.virgilsecurity.
You can either use Gradle or Maven to add it to your project dependencies.
Maven
Add jcenter
repository:
<repositories>
<repository>
<id>jcenter</id>
<name>jCenter</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
and add purekit
dependency:
<dependencies>
<dependency>
<groupId>com.virgilsecurity</groupId>
<artifactId>purekit</artifactId>
<version><latest-version></version>
</dependency>
</dependencies>
Gradle
Add jcenter
repository:
repositories {
jcenter()
}
and add purekit
dependency:
implementation 'com.virgilsecurity:purekit:<latest-version>'
The <latest-version> of the SDK can be found in the Maven Central Repository: https://mvnrepository.com/artifact/com.virgilsecurity/purekit
Initialize PureKit
Use the previously generated credentials to configure PureKit:
PureContext context = PureContext.createContext(
"AT.znqRZcOdzybj62Rzer897pX2DZ9KZoYF",
"NM.Qs0YFBS7Mr3Aaa9qn4OCVcNC1wvPCXfUpZNWFCPUOUI=",
"BU.MCowBQYDK2VwAyEAKWSBAZbbekJ5Ns36jRcjEiut3rH4rpaCCVnRxcB+d/E=",
"SK.1.ieSin9pO6Bx96+RJw/85fARl4fWdD9DfU/JQF+mbdqE=.hMnMH+oIg8eKZNxGq27LYQbzK4gDlvWvMLJh3jBCkRk=.
ug2KqJdUl50kYx+/RKcACLCR4zAujSlK6vQMvDKst+w=",
"PK.1.BO/YeE7oxlUad1TSpKb3DtudynpwB9miM/+1CsMkmf50qP/QUaYt7pXIxrsyLh38u08p6FFkCWedy/VhA//2MJY=.BPkoDhRO/01QmA8JIVcqxMQKrXfA4agTjBFEm42Lh5NIimcEFWUNWXZwq1Q962rxfkJd7kNZDpm0mlPLeHU+iyI=",
null);
Pure pure = new Pure(context);
If you want to use your own custom storage instead of Virgil Cloud for storing encryption keys and user records - for example, if you need a better performance - you'll need to go through the Set Up Custom Storage guide.
Next step
Now that you have PureKit installed and configured, you can move on to encrypting users' passwords as a part of user authentication: