AES encrypt with openssl command line tool, and decrypt in Java
问题 I have a bash script that uses the openssl tool to encrypt. #!/bin/bash key128="1234567890123456" iv="1234567890123456" openssl enc -aes-128-cbc -in test -out test.enc -K $key128 -iv $iv And Java code that tries to decrypt the file produced by the script. public class crypto { public static void main( String[] args ) { try { File f = new File("test.enc"); Cipher c; Key k; String secretString = "01020304050607080900010203040506"; String ivString = "01020304050607080900010203040506"; byte[]