这是Android中的代码:
val sr = SecureRandom()
val dks= DESKeySpec(KEY.toByteArray())
val keyFactory = SecretKeyFactory.getInstance("DES")
val secretKey = keyFactory.generateSecret(dks)
val cipher = Cipher.getInstance("DES/ECB/PKCS5Padding")
cipher.init(Cipher.DECRYPT_MODE, secretKey, sr)
cipher.doFinal(Base64.decode(data,Base64.DEFAULT))?.let {
return String(it,Charsets.UTF_8)
}
我想知道如何在Dart中实现它。