Re: How to decrypt a string?
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: 9 Feb 2007 03:24:13 -0800
On Feb 9, 11:03 am, "Kevin Spencer" <unclechut...@xxxxxxxxxxxx> wrote:
In this case, it's not arbitrary data. It's a string. The methods are
strongly-typed to encrypt and decrypt string data.
It starts off as a string, but encryption will turn it into arbitrary
binary data. An encrypted version of a UTF-8 string isn't necessarily
(and often won't be) a valid UTF-8 encoded string. Converting
encrypted data into a string just using Encoding.UTF8 (or the like) is
very, very likely to lose data. It's like trying to load up the
contents of a jpeg file as a string, pass that to someone else to
write out, and then expecting it to still load. It just won't work (in
the general case).
Base64 is absolutely the way to go here.
Jon
.
- Follow-Ups:
- Re: How to decrypt a string?
- From: Kevin Spencer
- Re: How to decrypt a string?
- References:
- How to decrypt a string?
- From: Ralph Moritz
- Re: How to decrypt a string?
- From: Ralph Moritz
- Re: How to decrypt a string?
- From: Jon Skeet [C# MVP]
- Re: How to decrypt a string?
- From: Kevin Spencer
- How to decrypt a string?
- Prev by Date: Re: How to decrypt a string?
- Next by Date: Re: .NEt 2.0 : Threading questions
- Previous by thread: Re: How to decrypt a string?
- Next by thread: Re: How to decrypt a string?
- Index(es):
Relevant Pages
|