[cryptopp-users] How to encrypt string and write to txt

2022-11-28 Thread Nikos Karavidas
Ok so based on the example from this link (https://www.cryptopp.com/wiki/Advanced_Encryption_Standard),i have tried encrypting a "plain" string into a "cipher" string and writing that "cipher" string to a .txt file in one program, and in another program afterwards reading that same .txt f

[cryptopp-users] Re: How to encrypt string and write to txt

2022-11-29 Thread Nikos Karavidas
Not sure what you mean by format, i just use something like "myFileStream << cipher", and then read it back again. Do you mean that the txt file should be utf-8 or something like that? What would be the right way to write the ciphered string to the txt file and read it afterwards? Thanks a lot

[cryptopp-users] Re: How to encrypt string and write to txt

2022-11-29 Thread Nikos Karavidas
I 've got the following function: void encrypt(string ivInString, string keyInString, const string &filename_in, const string &filename_out) { SecByteBlock iv(reinterpret_cast(&ivInString[0]), ivInString.size()); SecByteBlock key(reinterpret_cast(&keyInString[0]), keyInString.size());

[cryptopp-users] Re: How to encrypt string and write to txt

2022-11-29 Thread Nikos Karavidas
t; mystr << endl; and it works fine, all characters are printed in hex and i can write them in a txt file, no problem. BUT when i read them from the txt file, i dont know how to convert them back from hex, so i can do the decryption. On Tuesday, November 29, 2022 at 8:23:19 PM UTC+2 Nik

[cryptopp-users] Re: How to encrypt string and write to txt

2022-11-29 Thread Nikos Karavidas
helped a lot. On Tuesday, November 29, 2022 at 8:35:16 PM UTC+2 Nikos Karavidas wrote: > Ok so i got this figured out with this: > > stringstream ss; > > for (int i = 0; i < ciphertext.size(); ++i) > { > ss << hex <&