Encrypting a string

  • Thread starter Thread starter Bob Hollness
  • Start date Start date
B

Bob Hollness

OK, this has me pulling my hair out. All I want to do is encrypt/decrypt
strings. They may be up to 400 characters in length though.

So, I assume System.Security.Cryptography is the one to use.

All the examples I have found are driving me nuts. They are either way too
long for something that I guess should be fairly straightforward, or I do
not especially trust them as they look pretty bad. The sample from MS only
applies to streams which I am not using.

Does anyone have any help? Sample code, as always, is most appreciated.
 
Not sure if you have already looked at this or not. Check out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod25.asp

OK, this has me pulling my hair out. All I want to do is encrypt/decrypt
strings. They may be up to 400 characters in length though.

So, I assume System.Security.Cryptography is the one to use.

All the examples I have found are driving me nuts. They are either way too
long for something that I guess should be fairly straightforward, or I do
not especially trust them as they look pretty bad. The sample from MS only
applies to streams which I am not using.

Does anyone have any help? Sample code, as always, is most appreciated.
 
Thanks, i'll read through this. It applies to C# though. Do you have a VB
ready version?
 
Bob said:
OK, this has me pulling my hair out. All I want to do is encrypt/decrypt
strings. They may be up to 400 characters in length though.

So, I assume System.Security.Cryptography is the one to use.

All the examples I have found are driving me nuts. They are either way too
long for something that I guess should be fairly straightforward, or I do
not especially trust them as they look pretty bad. The sample from MS only
applies to streams which I am not using.

Does anyone have any help? Sample code, as always, is most appreciated.

My question thread:
http://groups-beta.google.com/group..._doneTitle=Back+to+Search&&d#a5e6f17c0d4fc80d

The solution thread:
http://groups-beta.google.com/group...ages.vb/browse_thread/thread/1e637c01e9fdd5b3

(thanks to Cor for the link)

HTH,
Greg
 
http://msdn.microsoft.com/library/d...emsecuritycryptographytripledesclasstopic.asp

Why have MS made this so difficult? If I want to encrypt a string it seems
very long-winded, whereas, if I want to encrypt an entire file there are
plenty of examples from them.
The only example they provide for encrypting a string uses the
RijndaelManaged class and is used to encrypt the key and IV. Either I have
missed something or it is not something easy.

AAARGRGGHHH, Help!!!!!
 

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

Back
Top