@Override public byte[] decrypt(byte[] encryptedBytes) { if (encryptedBytes == null) { return null; } else { return aesCipherService.decrypt(encryptedBytes, key).getBytes(); } }
@Override public byte[] decrypt(byte[] encryptedBytes) { if (encryptedBytes == null) { return null; } else { return aesCipherService.decrypt(encryptedBytes, key).getBytes(); } }
@Override protected byte[] decodeKeyBytes(String keyText) throws GeneralException { byte[] keyBytes = Base64.decodeBase64(keyText); if (kek != null) { keyBytes = saltedCipherService.decrypt(keyBytes, kek).getBytes(); } return keyBytes; }
@Override protected byte[] decryptValue(byte[] key, EncryptMethod encryptMethod, String encryptedString) throws GeneralException { switch (encryptMethod) { case SALT: return saltedCipherService.decrypt(Base64.decodeBase64(encryptedString), key).getBytes(); default: return cipherService.decrypt(Base64.decodeBase64(encryptedString), key).getBytes(); } }
public byte[] decrypt(byte[] ciphertext) { ByteSource plaintext = cipher.decrypt(ciphertext, key); return plaintext.getBytes(); }
private static byte[] decrypt(Key key, byte[] ciphertext) { AesCipherService cipherService = new AesCipherService(); ByteSource plainText = cipherService.decrypt(ciphertext, key.getEncoded()); return plainText.getBytes(); }
public byte[] decrypt(byte[] ciphertext, final byte[] key) { AesCipherService cipher = new AesCipherService(); cipher.setMode(OperationMode.ECB); cipher.setPaddingScheme(PaddingScheme.NONE); ByteSource plaintext = cipher.decrypt(ciphertext, key); return padding.removePadding(plaintext.getBytes()); }
Debug.logInfo("Decrypting with old key: " + oldKey, module); try { keyBytes = cipherService.decrypt(keyBytes, Base64.decodeBase64(oldKey)).getBytes(); } catch(Exception e) { Debug.logInfo("Failed to decrypt with Shiro cipher; trying with old cipher", module);