哪种密钥格式更适合AES 256 [英] Which type of Key Format is better for AES 256

查看:135
本文介绍了哪种密钥格式更适合AES 256的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我要使用 AES 256算法来加密和解密文件,而不是我必须提供用于加密文件的密钥和用于解密文件的相同密钥.

here i want to encrypt and decrypt files using AES 256 Algorithm than i have to provide Key for Encrypt the files and same key for decrypt the files.

那么哪个键对性能和安全性都更好呢?我将在此处使用哪种类型的密钥格式,以便获得更高的安全性.

So which Key is better for good performance and Security also? Which type of Format of key i will use here so i can get more security.

在这里,我必须在加密"和解密"中使用相同的密钥.

Here i have to use same key in Encrypt and Decrypt.

因此,任何人都可以向我建议关于Key的更好建议.

So Any body please can suggest me the better suggestions for Key.

推荐答案

AES 密钥只是一堆没有结构的位.AES-128密钥为128位,必须随机选择.AES-192密钥为192位,A​​ES-256密钥为256位.密钥没有任何不同的类型或格式.

An AES key is just a bunch of bits with no structure. An AES-128 key is 128 bits, which must be chosen randomly. An AES-192 key is 192 bits, an AES-256 key is 256 bits. There aren't any different types or formats of keys.

大多数密码库都具有生成AES密钥的功能.例如,使用 PKCS#11 接口,在OpenSSL中具有 RAND_bytes .

Most cryptography libraries will have a function to generate an AES secret key. For example, with a PKCS #11 interface, call C_GenerateKey with the CKM_AES_KEY_GEN mechanism. If the library doesn't have a specific function, use it to generate the required number of random bytes, for example with RAND_bytes in OpenSSL.

请咨询您的密码库的实现,以确保正确使用.特别是,随机数生成器需要其环境中的,请确保您提供足够的东西.

Consult your cryptographic library's implementation for proper usage. In particular, a random number generator requires entropy from its environment, make sure you are providing enough.

这篇关于哪种密钥格式更适合AES 256的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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