Re: encrypt email address to a string

From: G Klinedinst (g_klinedinst_at_hotmail.com)
Date: 12/17/03


Date: 17 Dec 2003 09:20:14 -0800


"Fengshui" <test@test.com> wrote in message news:<5X1Db.455457$0v4.20982854@bgtnsc04-news.ops.worldnet.att.net>...
> domain rule is as: caseless letters, numbers and -
>
> username rule is letters. numbers, -, _ and .
>
> so if I want to covert/encript an email into a letter/number only string,
> how do i do this without adding length to the string? i don't want to just
> exchange ascii code for each one.
If you just want to keep spiders from picking up email addresses I
would simply reverse the string, like Abigail said or remove the
punctuation and replace with something else. Perl's tr or s should
work fine here.

If you want to keep it from prying human eyes, as long as they are
lazy something simple should work.

You don't want to do an even ASCII exchange mapping because you don't
want to access a table like you say in one of your follow ups? You
wouldn't need to even use a table. You could just use a simple
algorithm. Add or subtract some number from your ascii code(make sure
you stay within the bounds of what can be transferred by your medium,
and make a simple escape sequence for illegal characters), then do the
reverse on the flip side.

On the other hand if your issue is that a simple mapping is too easy
and someone could figure it out then I would say you are probably
stuck with increasing the length. I don't see how you could add
complexity using the same number or less of characters and the same
character set, unless the data set had large quantities of repetitive
data which would lend itself to compression. Any mathmaticians want to
advise on this one?

Lastly, I think you are going the wrong direction talking about
converting to a different character set, or encoding using hex. If you
want to represent all usable ASCII characters you are talking a
minimum of 128 characters, and extended ASCII is 256. That means 2
places in hex and 3 in decimal. Then you need to represent that in
"characters" to transfer it, so you are doubling or tripling the size
of the string. In other words, using base-10 or base-16 to represent
base-128 is definately going to make your string longer, since you
will no be transferring integers, you will be transferring characters
which will get implicitly converted back to integers when you use
them.

Let me know if this makes any sense. I am tired and rambling a little.

-GPK



Relevant Pages

  • Re: Slightly tricky string problem
    ... I have a String, which is single character eg "a" ... ASCII is a code defining 128 entities, ... So an UTF-8 encoded file containing only ASCII characters shall ... Unicode didn't define codepoints outside the BMP. ...
    (comp.lang.java.programmer)
  • Re: Slightly tricky string problem
    ... I have a String, which is single character eg "a" ... ASCII is a code defining 128 entities, ... So an UTF-8 encoded file containing only ASCII characters shall ... Unicode didn't define codepoints outside the BMP. ...
    (comp.lang.java.programmer)
  • Re: Reading an Ascii string
    ... When said "Ascii characters", I meant that they are stored as bytes rather than 16-bit quantities as unicode requires. ... so a string with three characters appears as byte 0x14 followed by the three characters followed by 17 space characters. ... I'll get rid of the text box and store them directly in the database. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Writing extended ascii characters to text file.
    ... so in order to get real ASCII codes you should use the GetBytes ... method of an Encoding instance configured for the ASCII encoding (as far as ... again, you've got bytes, not characters. ... > string line; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)