d'OpenSSL J'essaie de comprendre les paramètres de la fonction suivante dans la bibliothèque cryptographique openSSL.Détails des paramètres de AES_ctr128_encrypt()
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num);
En travaillant à travers les suggestions données here j'ai pu comprendre:
*in - is the buffer in.
*out - is the buffer out.
length - is the the length of the *in buffer.
*key - is the private key.
ivec[0-7] - is the random IV
ivec[8-15] - is the counter thats incremented for every block that's encrypted.
Je ne suis pas certain sur les paramètres
ecount_buf
etnum
.
Je vois que num
est défini sur length % AES_BLOCK_SIZE
après l'appel revient.
Des pointeurs sur le paramètre
ecount_buf
?
Vous ne devriez pas utiliser 'AES_encrypt' et vos amis. C'est une implémentation logicielle uniquement, de sorte que vous ne bénéficierez pas du support matériel, comme AES-NI. Vous devriez utiliser les fonctions 'EVP_ *'. Voir [EVP Symmetric Encryption and Decryption] (http://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption) sur le wiki OpenSSL. En fait, vous devriez probablement utiliser un chiffrement authentifié, car il fournit * la * confidentialité et l'authenticité. Voir [Chiffrement et décryptage authentifiés par EVP] (http://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption) sur le wiki OpenSSL. – jww