End of String Character?



Help, I am using an encryption routine that occasionally will encrypt a
string using some extended ASCII characters (ASCII code > 128)

I am wondering if there is a reserved character in VB that signifies
the end of a string of characters.

Here is what happens: I am encrypting certain fields before adding
them to a SQL string. On occassion, the SQL string will simply end in
the middle of the encrypted value.

Example code

sSQL = "EXEC SaveDetails " & _
" @iDetailID = " & iDetailID & ", " & _
" @sEncryptedText = '" & _
replace(EncryptText(sText),"'","''") & "', " & _
" @iOtherValue = 6"

Normally Response.Write would print something like this:

using Response.Write(Server.HTMLEncode(sSQL)):

EXEC SaveDetails @iDetailID = 3, @sEncryptedText = 'aw@##@QASV@#AV (!',
@iOtherValue = 6

Occasionally on certain inputs for sEncryptedText it will print:

EXEC SaveDetails @iDetailID = 3, @sEncryptedText = '@#DFVIDXZI

Is my encryption algorithm possible generating a reserved character
that signifies the end of a string? Does such a character exist in
VBscript? Any help would be appreciated.

FYI, I'd rather not post my encryption routine. Please let me know if
you feel it would be necessary.

.



Relevant Pages

  • Need help to remove tbas, carriage retrun, and other!!!
    ... ASCII code of the character ... that I link to) to specify the string that you want to ... optionally the ascii chr number of the delimiter ... 'At the start point of the string (1 character after the ...
    (microsoft.public.access.queries)
  • Re: Microsoft.VisualBasic.Strings.Asc ?
    ... I'm trying to put together a simple utility to do rc4 encryption based on the rc4 algorithm here: ... You don't need to use Substring to access a single character in a string, and you don't need ToCharArray to convert a single character string to a character. ... Actually, the encryption methods in the .NET framework doesn't take strings at all, they encrypt streams of bytes, so the method should probably do the same and leave the encoding to the one using the method. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: simple string encryption
    ... which seems to be a fast and small xor encryption algorithm. ... string into a textbox and then read the string from the textbox ... The reason is because strings in VB use two bytes per character and your code, as it stands, is messing about with both bytes of each character. ...
    (microsoft.public.vb.general.discussion)
  • Re: Encryption algorithm
    ... > character alphanumeric string in a COBOL program. ... consider these "obscuring" rather than "encryption", ... that you run the string through the same algorithm to encode and decode. ... This has the advantage of working with pretty much any character you'd ...
    (comp.lang.cobol)
  • Re: REWARD: chr() not working for Chinese "Locale"
    ... I have a routine that encrypts a string. ... >> value the encryption routine generated for each character, ... > into a string which is likely to survive whatever you throw at it. ... >> encryption routine tries to set a character to a value in this range, ...
    (microsoft.public.pocketpc.developer)