Re: Encrypting Data into a string

Maybe you should show your code? It sounds like you have a misunderstanding
of how you should be encoding your data. Basically, you use Base64 to
represent arbitrary binary data as a string. Base64 is good for this
purpose because it can deal with binary data that doesn't have a good
natural string representation such as data with embedded nulls and other
non-printable characters. Examples of "arbitrary binary data" in the
context of crypto include encrypted data, hashes and keys.

If you have a string of plain text and need to encrypt that, you typically
want to use a text-based encoding such as UTF8 to convert that into binary.

Joe K.

Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
<michaelloveusa@xxxxxxxxx> wrote in message
Hi there.

I am trying to encrypt a connect string that has some special
characters in it (i.e. ';' and '=' and whatever other funky chars can
be in a password). So this chokes when I use the Convert.ToBase64 and
Convert.FromBase64 methods. I need the result to be a legitimate
string that I can put into a config file. Any ideas on how to best
overcome this issue?

Thanks, Mike


Relevant Pages

  • Re: string bug?
    ... I am developing a 'server' script, receiving BINARY data via STDIN using ... I thought that string functions were binary safe. ... If UTF encoding is used, ... should provide number of "UTF" characters. ...
  • Re: Compress ASCII text as Hex?
    ... There an encoding format code BASE64 (also known as UUEncoding in some ... It take fully binary data and converts it a set of 64 ... characters, so encoded blocks increase 33% in size. ... as long as your "encoded" string meets ...
  • Re: Base64 conversion for unicode
    ... >> mainly met base64). ... >> different to an ANSI string or a binary file. ... > I think it would depend on the function declaration. ... because Delphi strings handle binary data quite ...
  • Re: UTF-8 encoding in AJAX web application.
    ... and if you print the string it would be be printed incorrectly because ... you would be assuming a UTF-16 encoding when the encoding is in fact UTF-8. ... Encodings are only involved when converting text data to binary data ...
  • Re: Signature verification with capicom
    ... the problem was the character encoding. ... I know the method to convert the text and binary data to unicode (I ... the byte array is converted to a String ...