Click here to Skip to main content
15,914,608 members

Comments by unix_area (Top 2 by date)

unix_area 16-Jun-11 2:58am View    
Thank you for all. I solve it
unix_area 8-Jun-11 6:11am View    
Actually problem is: when I encode a string to Byte for Decrypting, I have an error like: Inadmissible length of the data for decoding.
exc:
you will see it, just replace button action
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

String^ STR =tbString->Text->Trim();
array<byte>^ buffer = Encrypt( STR, key );
Encoding^ ascii = Encoding::ASCII;
String^ decodedString = ascii->GetString( buffer );
tb_Encrypted->Text = decodedString;

array<byte>^ test = ascii->GetBytes( tbString->Text );

String^ plaintext = Decrypt( test, key );
tb_Decrypted->Text = plaintext;


}