AesBytesEncryptorTests Check Key Strength

Fixes: gh-6121
This commit is contained in:
Josh Cummings 2018-11-20 10:11:01 -07:00
parent 7232dabd48
commit 9ee291e659
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public class AesBytesEncryptorTests {
@Test
public void roundtripWhenUsingDefaultsThenEncryptsAndDecrypts() {
CryptoAssumptions.assumeCBCJCE();
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt);
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
byte[] decryption = encryptor.decrypt(encryption);
@ -54,6 +55,7 @@ public class AesBytesEncryptorTests {
@Test
public void roundtripWhenUsingDefaultCipherThenEncryptsAndDecrypts() {
CryptoAssumptions.assumeCBCJCE();
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator);
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
assertThat(new String(Hex.encode(encryption)))
@ -65,6 +67,7 @@ public class AesBytesEncryptorTests {
@Test
public void roundtripWhenUsingGcmThenEncryptsAndDecrypts() {
CryptoAssumptions.assumeGCMJCE();
AesBytesEncryptor encryptor = new AesBytesEncryptor(this.password, this.hexSalt, this.generator, GCM);
byte[] encryption = encryptor.encrypt(this.secret.getBytes());
assertThat(new String(Hex.encode(encryption)))