fix key copy

This commit is contained in:
2025-11-21 21:59:08 +01:00
parent 22ac094680
commit f604b51d72
2 changed files with 2 additions and 6 deletions

View File

@@ -56,11 +56,8 @@ void cipher::init(const string& phrase) {
dig.initDigest();
dig.putDigest( (unsigned char *)phrase.c_str(), phrase.length() );
__key = dig.stringDigest(); // this is a 32 byte long string, as Rijndael:: expects
/* convert the key to unsigned char[] */
for(int i=0; i<32; i++) {
key[i] = __key[i];
}
memcpy(key, __key, 32);
}

View File

@@ -61,7 +61,6 @@ class cipher {
Rijndael rijn;
MD5Digest dig;
unsigned char key[32];
string blah;
const char* error(int num);
public: