Skip to content

Commit

Permalink
Merge branch 'fix/remove-cipher-todo' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sluehr committed Oct 17, 2020
2 parents 75766cc + 26dd76a commit 056538e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public DefaultAesDecrypter(SecureRandom secureRandom) {

public String decrypt(SecretKey secretKey, byte[] initializationVectorAndCipherText) {
try {
// TODO this doesn't look reentrant
var cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(DECRYPT_MODE, secretKey, new IvParameterSpec(initializationVectorAndCipherText, 0, INITIALIZATION_VECTOR_LENGTH), secureRandom);
return new String(cipher.doFinal(initializationVectorAndCipherText, INITIALIZATION_VECTOR_LENGTH, initializationVectorAndCipherText.length - INITIALIZATION_VECTOR_LENGTH));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public DefaultAesEncrypter(SecureRandom secureRandom) {

public byte[] encrypt(SecretKey secretKey, String cleartext) {
try {
// TODO this doesn't look reentrant
var cipher = Cipher.getInstance(CIPHER_ALGORITHM);
byte[] initializationVector = createInitializationVector();
cipher.init(ENCRYPT_MODE, secretKey, new IvParameterSpec(initializationVector), secureRandom);
Expand Down

0 comments on commit 056538e

Please sign in to comment.