String trouble

From: Pjotr Wedersteers (x33159_at_westerterp.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 15:46:58 +0200

I am using a function that does a very basic encryption (rotation based) of
data.
Data is a string which may contain a..z,A..Z,0..9,[],(),|,{}"', length
limited to 255 chars.

The problem I have is the following:

Let's say my $string is 'This is a string'
At a given moment encrypt ($string) yields '6noq4oq4"q6{o]3' as a result.
When I decrypt that I get my original string back. But if I send the
encrypted string in a POST var, this is what I get:
'6noq4oq4\"q6{o]3'; So the " gets escaped and decrypt produces undesired
results.
I don't want that. I want whatever I am putting in to come out verbatim in
the receiving script.

Which function(s) will help me do this ?

THANKS!
Pjotr

PS I am aware of exisiting PHP hash and encrypt functions. This is for
demonstration purposes only.



Relevant Pages

  • Re: Encrypt and Decrypt a file using .NET 2.0?
    ... public static string GenerateKey() ... DES des = DES.Create; ... // Distribute this key to the user who will decrypt this file. ... // Get the Key for the file to Encrypt. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET Crypto Classes Interoperability with Win32 Crypto APIs
    ... >the hash of the string you are feeding in. ... when i encrypt a string using .NET classes and try ... >> decrypt it using Win32 APIs, ...
    (microsoft.public.dotnet.security)
  • Re: Encrypt and Decrypt a file using .NET 2.0?
    ... public static string GenerateKey() ... using (CryptoStream cryptoStream = new CryptoStream(outFile, ... // Distribute this key to the user who will decrypt this file. ... // Get the Key for the file to Encrypt. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: 2007 User Level Security
    ... encrypted string. ... the way I use it is to encrypt user names and passwords and store the ... Dim prp As Property ... Dim dbs As Object, prp As Variant ...
    (microsoft.public.access.modulesdaovba)
  • Re: Workable encryption in Tcl??
    ... The longest string would be about the length ... How to encrypt a string ... nothing about binary formats. ... ># Perform ECB mode encryption on a plaintext block of BINARY data. ...
    (comp.lang.tcl)