Re: Trying to encrypt a string

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
.



Relevant Pages

  • Re: Audio scrambling?
    ... Was there ever a decent implementation of WW2-style audio scramblers ... Modern implementations first digitize the audio stream, then encrypt ... Signal-to-noise ratio and other real-world properties of the ... Synchronizing and decrypting in real time may be more challenging. ...
    (sci.crypt)
  • Re: Audio scrambling?
    ... Was there ever a decent implementation of WW2-style audio scramblers ... Modern implementations first digitize the audio stream, then encrypt digitally and then convert back to analog. ... Signal-to-noise ratio and other real-world properties of the communications channel limit the combination of parameters that can be used effectively. ... Synchronizing and decrypting in real time may be more challenging. ...
    (sci.crypt)
  • Re: Audio scrambling?
    ... Was there ever a decent implementation of WW2-style audio scramblers ... Modern implementations first digitize the audio stream, then encrypt digitally and then convert back to analog. ... Signal-to-noise ratio and other real-world properties of the communications channel limit the combination of parameters that can be used effectively. ... Synchronizing and decrypting in real time may be more challenging. ...
    (sci.crypt)
  • Re: How can I use AES to encrypt something less than 16 bytes?
    ... > For four rounds, pad the right half to 16 bytes, encrypt it with AES, ... decrypting the message does not have access to the plaintext password. ... the server must not have any flexibility in its protocol. ... The System A will pass the authentication data to System B, ...
    (sci.crypt)
  • Re: Trying to encrypt a string
    ... >>>I'm trying to encrypt passwords in my app. ... The problem is that after decrypting, ... >> The ultimate truth is that there is no ultimate truth ...
    (microsoft.public.dotnet.languages.csharp)