String Encrypt and Decrypt Examples

G

Guest

Where can I find a code example that will demonstrate the encryption and decryption of a string in C#
I am familiar with "System.Security.Cryptography" encryption, but need a system that will both encrypt and decrypt a string

Is it possible to convert a string that represents a byte array as the output string below


string input = "something"
Byte[] clearBytes = new UnicodeEncoding().GetBytes(input)
string output = BitConverter.ToString(clearBytes)


back into original string "something"

Thank you
 
B

Bruno van Dooren

are the encryption / decryption classes in system.security.cryptography not
good enough?
they can do exactly what you ask for, or am i missing something?

kind regards,
Bruno.


Greg R said:
Where can I find a code example that will demonstrate the encryption and decryption of a string in C#?
I am familiar with "System.Security.Cryptography" encryption, but need a
system that will both encrypt and decrypt a string.
Is it possible to convert a string that represents a byte array as the output string below:

{
string input = "something";
Byte[] clearBytes = new UnicodeEncoding().GetBytes(input);
string output = BitConverter.ToString(clearBytes);
}

back into original string "something"?

Thank you
 
A

Alek Davis

Greg,

Check this: http://www.obviex.com/samples/encryption.aspx.

Alek

Greg R said:
Where can I find a code example that will demonstrate the encryption and decryption of a string in C#?
I am familiar with "System.Security.Cryptography" encryption, but need a
system that will both encrypt and decrypt a string.
Is it possible to convert a string that represents a byte array as the output string below:

{
string input = "something";
Byte[] clearBytes = new UnicodeEncoding().GetBytes(input);
string output = BitConverter.ToString(clearBytes);
}

back into original string "something"?

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top