AES/CBC encrypt in Java, decrypt in Ruby

后端 未结 2 1115
小蘑菇
小蘑菇 2021-01-03 10:27

I am trying to translate the following (working) Java code to Ruby.

   public static final String PROVIDER = \"BC\";
   public static final int IV_LENGTH = 1         


        
2条回答
  •  醉话见心
    2021-01-03 11:19

    I once had a similar problem with CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding"; and decryption through the openSSL-library in C which I could't solve. I avoided the problem by using "AES/CBC/NoPadding" and by adding a particular padding to the plaintext manually.

提交回复
热议问题