English 中文(简体)
AES 替代框
原标题:Substitution box for AES

我需要执行 AES (高级加密标准) 。 根据标准, 每回合我用 s-box 替换字节( 如 : 4F - & gt; 84) 。 我的问题是, 我是否需要将 s- box 作为变量存储在 C++ 源代码中, 或者我可以为每个字节计算?

最佳回答

S-Box 背后的想法是,它可以在解密期间恢复。 因此, S-box 中的值是恒定的。 计算每个字节的 S-box 是多余的, 并且不必要地重复 。

您应该复制并粘贴一个 < a href=" https://gist.github.com/mb720/6662deb7bff28ff28d80e4302196d16c2" rel= "nofollow noreferr" > 现有的表 或一开始就计算一次。 < a href="https://en.wikipedia.org/wiki/Rijndael_S-box" rel=“nofollown noreferrer" > 这个 < a > 网站可以解释和一些S-box初始化的例子。

问题回答

暂无回答




相关问题
Extend Contacts application on Android to provide encryption

I want to encrypt individual contacts stored by the Contacts application on Android based on user s preference. So, I am thinking I ll have to hook/extend the Contacts application before the it stores ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

Thread & Queue vs Serial performance

I though it ll be interesting to look at threads and queues, so I ve written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I m still very new ...

Convert PHP encryption code to C#

I m trying to convert this piece of code from PHP to C#. It s part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = ...

Encryption: how to have 1 iv despite multiple fields

I ve been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I m encrypting an address and I ...

热门标签