以下代码无法编译,并显示消息:cannot instantiate type SymmetricKey SymmetricKey是一个接口。我该如何解决这个问题?
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InitializationVector iv = new InitializationVector("helo".getBytes());
SymmetricKey key = new SymmetricKey("AES_256","key", 0, "
我使用的是没有问题的as3Crypto
但它会生成一个包含等号(可能还有其他URL查询不安全字符)的字符串。有像这样加密的方法吗?
当前代码如下:
public function encrypt(txt:String = ''):String
{
var data:ByteArray = Hex.toArray(Hex.fromString(txt));
var pad:IPad = new PKCS5;
var mode:ICipher = Crypto.getCipher(type, key, pad);
pad.setBloc