Re: Trying to encrypt a string
- From: kfrost <kris@xxxxxxxxx(donotspam)>
- Date: Thu, 15 Dec 2005 15:41:02 -0800
Possibly because he needs to use the credentials for something. For example,
creating an app that cache's user credentials in the registry to access a
service on the web.
If you want to give end users a way to cache username and password, but have
to retrieve it back to text to pass it from your application.
--
kris@xxxxxxxxx<Remove This Before Emailing>
Network & Software Integration
www.n-sv.com
"Helping put the pieces of your IT puzzle together"
"rossum" wrote:
> On 7 Dec 2005 03:05:27 -0800, toupeira23@xxxxxxxxx wrote:
>
> >Hello,
> >
> >I'm trying to encrypt passwords in my app. After discovering that
> >there's no simple function to do this, I wrote a wrapper class which
> >decodes a string using UTF8, encrypts it with TripleDES and returns a
> >Base64-encoded string. The decryption function does the reverse, i.e.
> >Base64-decodes the string, decrypts it with the same Key and IV, and
> >encodes it again with UTF8. The problem is that after decrypting, the
> >8th character is not the same as it was before, e.g. in the example
> >below "testtest" changes to "testtesC". It's always on the 8th
> >character, all others are correctly decrypted. And the really strange
> >thing is, if you enable the commented-out code in Main(), it works
> >correctly! I've tried recreating the TripleDESCryptoServiceProvider on
> >every encrypt/decrypt, but that doesn't help.
> >
> >Can anybody explain what's going on? Is this a(nother) bug in .NET
> >itself?
> >
> >Here's the code I'm using:
> >
> [snip code]
> >
> >thanks,
> >markus
>
> A thought - why are you decrypting passwords?
>
> When the user enters a password just encrypt it and see if it matches
> with the stored encrypted version. If the encrypted versions match
> then the plaintext versions would have matched (assuming a reasonable
> encryption scheme).
>
> rossum
>
>
> The ultimate truth is that there is no ultimate truth
>
.
- Follow-Ups:
- Re: Trying to encrypt a string
- From: rossum
- Re: Trying to encrypt a string
- References:
- Trying to encrypt a string
- From: toupeira23
- Re: Trying to encrypt a string
- From: rossum
- Trying to encrypt a string
- Prev by Date: Re: How to catch Console window content from windows project?
- Next by Date: Deriving a more specific interface from a generic interface
- Previous by thread: Re: Trying to encrypt a string
- Next by thread: Re: Trying to encrypt a string
- Index(es):
Relevant Pages
|