how to use OpenSSL to decrypt Java AES-encrypted data?

前端 未结 3 830
说谎
说谎 2021-01-03 15:03

I\'m interfacing to a legacy Java application (the app cannot be changed) which is encrypting data using AES. Here is how the original Java code is instantiating the AES ci

3条回答
  •  借酒劲吻你
    2021-01-03 15:35

    Some cryptographic algorithms require additional initialization parameters; these can be passed to init() as a java.security.AlgorithmParameters object or as a java.security.spec.AlgorithmParameterSpec object. When encrypting, you can omit these parameters, and the Cipher implementation uses default values or generates appropriate random parameters for you. In this case, you should call getParameters() after performing encryption to obtain the AlgorithmParameters used to encrypt. These parameters are required in order to decrypt, and must therefore be saved or transferred along with the encrypted data.

    http://docstore.mik.ua/orelly/java-ent/jnut/ch26_01.htm

    Are you able to modify the Java code to get ahold of these parameters?

提交回复
热议问题