您好我有一个java android加密方法,并希望转换为ruby代码。
IvParameterSpec localIvParameterSpec = new IvParameterSpec(new byte[] { 12, 34, 34, 11, 64, 23, 89, 27 });
DESKeySpec localDESKeySpec = new DESKeySpec(paramString2.getBytes());
SecretKey localSecretKey = SecretKeyFactory.getInstance("DES").generateSecret(localDESKeySpec);
Cipher localCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
localCipher.init(1, localSecretKey, localIvParameterSpec);
return new String(Base64.encode(localCipher.doFinal(paramString1.getBytes()), 0));
我谷歌一些有用的文章,但仍然无法获得相同的输出。 所以任何人都知道上面的java代码的ruby代码?
THX!
答案 0 :(得分:0)
foreach(var destination in destinations)
{
Console.WriteLine(destination.Description);
Console.WriteLine(destination.Text);
Console.WriteLine("\n");
}