C
C#11mo ago
DarkVader

Encoding.Default.GetString() and then Encoding.Default.GetBytes() create two different byte[], How?

So If I do this
var encodedBytes = XXTEACipher.EncryptCFB(originalBytes, key);

var encodedText = Encoding.Default.GetString(encodedBytes);
var encodedBytesTest = Encoding.Default.GetBytes(encodedText);
var encodedBytes = XXTEACipher.EncryptCFB(originalBytes, key);

var encodedText = Encoding.Default.GetString(encodedBytes);
var encodedBytesTest = Encoding.Default.GetBytes(encodedText);
Somehow encodedBytes[] and encodedBytesTest[] are different in values and length, how is this possible, or what am I missing?
No description
1 Reply
Omnissiah
Omnissiah11mo ago
if you are converting to string random bytes it's quite possible that some on the characters don't exist
Want results from more Discord servers?
Add your server