73c58bafe578c59366d8c995cd0b9d6d
test
import java.io.unsupportedencodingexception;import java.security.invalidkeyexception;import java.security.messagedigest;import java.security.nosuchalgorithmexception;import java.security.securerandom;import javax.crypto.badpaddingexception;import javax.crypto.cipher;import javax.crypto.illegalblocksizeexception;import javax.crypto.keygenerator;import javax.crypto.nosuchpaddingexception;import javax.crypto.secretkey;import javax.crypto.spec.secretkeyspec;public class aesutil { public static void main(string[] args){ // system.out.println(hello,it's:); string content=test; string password=12345678; string estr = encrypt(content, password); system.out.println(estr); system.out.println(decrypt(estr, password)); } /**将16进制转换为二进制 * @param hexstr * @return */ public static byte[] parsehexstr2byte(string hexstr) { if (hexstr.length()
php版本自己写了
';echo security::decrypt($value, $key );
回复内容: java类转成php版本,麻烦大神看一下php版本哪里问题
73c58bafe578c59366d8c995cd0b9d6d
test
import java.io.unsupportedencodingexception;import java.security.invalidkeyexception;import java.security.messagedigest;import java.security.nosuchalgorithmexception;import java.security.securerandom;import javax.crypto.badpaddingexception;import javax.crypto.cipher;import javax.crypto.illegalblocksizeexception;import javax.crypto.keygenerator;import javax.crypto.nosuchpaddingexception;import javax.crypto.secretkey;import javax.crypto.spec.secretkeyspec;public class aesutil { public static void main(string[] args){ // system.out.println(hello,it's:); string content=test; string password=12345678; string estr = encrypt(content, password); system.out.println(estr); system.out.println(decrypt(estr, password)); } /**将16进制转换为二进制 * @param hexstr * @return */ public static byte[] parsehexstr2byte(string hexstr) { if (hexstr.length()
php版本自己写了
';echo security::decrypt($value, $key );
