src/test/java/com/hedera/hashgraph/identity/hcs/AesEncryptionUtil.java
/**
   * Decrypts the given message encrypted with AES and defined secret phrase.
   *
   * @param messageToDecrypt Message to decrypt.
   * @param secret           The encryption secret.
   * @return The decrypted message.
   */
Decrypts the given message encrypted with AES and defined secret phrase.
@param messageToDecrypt Message to decrypt.
@param secret           The encryption secret.
@return The decrypted message.
Decrypts the given message encrypted with AES and defined secret phrase . @param messageToDecrypt Message to decrypt . @param secret The encryption secret . @return The decrypted message .
public static byte[] decrypt(byte[] messageToDecrypt, String secret) {
    try {
      SecretKeySpec secretKey = secretToKey(secret);
      Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
      cipher.init(Cipher.DECRYPT_MODE, secretKey);
      return cipher.doFinal(messageToDecrypt);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
public static byte [ ] decrypt ( byte [ ] messageToDecrypt , String secret ) { try { SecretKeySpec secretKey = secretToKey ( secret ) ; Cipher cipher = Cipher . getInstance ( "AES/ECB/PKCS5PADDING" ) ; cipher . init ( Cipher . DECRYPT_MODE , secretKey ) ; return cipher . doFinal ( messageToDecrypt ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Decrypts the given message encrypted with AES and defined secret phrase.
Decrypts the given message encrypted with AES and defined secret phrase .