--- Dale Kingston <[EMAIL PROTECTED]> wrote:
> ok i have a question on how to do something, i'm bad with words so i'll show
> the code.

I think what you'd want is something like..

  void encrypt(char *string)
  {
      int i, c;
      char buf[MSL];

    for(i = 0; string[i] != '\0'; i++)
    {
-     for (c = 0; key_table[c].letter1 != NULL; c++)
+     for (c = 0; key_table[c].letter != '\0'; c++)
      {
-              if (!str_cmp(string[i], key_table[c].letter1))
-                 string[i] = key_table[c].letter2;
+              if (string[i] == key_table[c].letter)
+                 string[i] = key_table[c].cypher;
      }

    }
    return;
  }

  struct key_type
  {
-     char *letter1;
-     char *letter2;
+     char letter;
+     char cypher;
  };


But this isn't a good form of encryption at all since it will consistantly
change the same letters into the same cyphers, so it's very easy to figure out
the pattern.

~Kender

=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$
P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O
M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to