Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.

Commit

Permalink
Inclusion of test with KDF only to demonstrate the usage
Browse files Browse the repository at this point in the history
of KDF functions with SecretBox
  • Loading branch information
Bruno Oliveira committed Mar 20, 2014
1 parent bc8dde5 commit 2a07397
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pom.xml
Expand Up @@ -70,6 +70,16 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.aerogear</groupId>
<artifactId>aerogear-crypto</artifactId>
<version>0.1.3</version>
</dependency>
<dependency>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>140</version>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/abstractj/kalium/crypto/SecretBoxTest.java
Expand Up @@ -68,7 +68,9 @@ public void testEncrypt() throws Exception {
@Test
public void testDecrypt() throws Exception {

SecretBox box = new SecretBox(SECRET_KEY, HEX);
Pbkdf2 pbkdf2 = AeroGearCrypto.pbkdf2();
byte[] key = pbkdf2.encrypt("123", new Random().randomBytes());
SecretBox box = new SecretBox(key);

byte[] nonce = HEX.decode(BOX_NONCE);
byte[] expectedMessage = HEX.decode(BOX_MESSAGE);
Expand Down

0 comments on commit 2a07397

Please sign in to comment.