AES-128-CTR加密帮助 [英] aes-128-ctr encryption help

查看:175
本文介绍了AES-128-CTR加密帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我对此知之甚少,并且正在寻找像这样的示例工作代码:

At present, I know little about this and am looking for working code as an example like this:

https://www.codeproject.com/articles/769741 /csharp-aes-bits-encryption-library-with-salt

上面的链接似乎是针对256位的.

The above link appears to be for 256 bit.

也许是这样:

https://www.codeproject.com/Articles/26085/File -C中的加密和解密

请发表评论以帮助我理解.

Please comment to help my understanding.

我的问题之一是如何测试密码是否正确.

One of the questions I have is how does it test if the password is correct or not.

推荐答案

嗨jack0987,

Hi jack0987,

谢谢您在这里发布.

对于AES-128-ctr加密,您想在代码项目中查看以下示例.

For AES-128-ctr encryption, you would like to check the following example in code project.

https://www.codeproject.com/Articles/1085427/Symmetric-Key -通过AES加密

AES是一种128位分组密码,接受128、192的密钥长度和256位.所需的轮数(即线性和非线性变换)取决于 密钥大小.

AES is a 128 bit block cipher that accepts key lengths of 128, 192, and 256 bits. The required number of rounds (i.e., linear and non-linear transformations), depend on the key size.

AES描述的算法是对称密钥算法,含义相同密钥用于加密和解密数据;

请检查墨水,它显示了不错的介绍.

>>一个我的问题是如何测试密码是否正确.

加密算法不知道输入密钥是否正确!该算法可以很好地解密任何密钥.它只会以垃圾结尾 使用错误的密钥.使用加密的应用程序一旦完成就可能能够检测到该消息,因为解密后的消息可能具有无效的填充或将以其他方式变形,但是AES本身绝不会抛出异常".

The encryption algorithm doesn't know whether the input key is correct or not! The algorithm works just fine decrypting with any key; it'll just end up with garbage if you use the wrong key. The application using the encryption may be able to detect this once it's done, because the decrypted message will probably have invalid padding or will be malformed in other ways, but AES itself will never "throw an exception".

最好的问候,

Wendy


这篇关于AES-128-CTR加密帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆