Encrypt/Decrypt 
Author Message
 Encrypt/Decrypt

Hi!
    I'm trying to write a string to file and then read the string back
out of the file
encrypted.  The method is called the Ceasar Method where the characters
are
encrypted two letters past the original.  See Example!!!

                                  String::  Hello and Good morning.
                    Encrypted Str::::  Jgnnq cpf Iqqf oqtpkpi.

    This encryption does not alter nothing but the alphabetic
characters.
Can someone give me a hand getting this off the ground, so to speak.

Thanks!




Wed, 18 Jun 1902 08:00:00 GMT  
 Encrypt/Decrypt

Quote:

> Hi!
>     I'm trying to write a string to file and then read the string back
> out of the file
> encrypted.  The method is called the Ceasar Method where the characters
> are
> encrypted two letters past the original.  See Example!!!

>                                   String::  Hello and Good morning.
>                     Encrypted Str::::  Jgnnq cpf Iqqf oqtpkpi.

>     This encryption does not alter nothing but the alphabetic
> characters.
> Can someone give me a hand getting this off the ground, so to speak.

> Thanks!



     If you want to "do arithmetic" on letters (i.e. "go two letters up",
worrying, of course, about what to do with "z", and thinking about upper
and lower cases), you may want to consider the functions ord() and chr(),
which allow you to map characters into integers, and back again.

Bob Schor
Pascal Enthusiast



Wed, 18 Jun 1902 08:00:00 GMT  
 Encrypt/Decrypt

Quote:

>Hi!
>    I'm trying to write a string to file and then read the string back
>out of the file
>encrypted.  The method is called the Ceasar Method where the characters
>are
>encrypted two letters past the original.  See Example!!!

>                                  String::  Hello and Good morning.
>                    Encrypted Str::::  Jgnnq cpf Iqqf oqtpkpi.

>    This encryption does not alter nothing but the alphabetic
>characters.
>Can someone give me a hand getting this off the ground, so to speak.

>Thanks!



Let me guess?
A homeword assignment?

Well sometimes you need some help!
I'm gonna give you 2 tips:
1- Use succ and pred to change the letters
2- The string variable is like an array of char
3- Put in an if statemant so that you only change the alfabet charachters!
  there ascii values are between 65-90 and 97-122 use ord()

Hope this gets you off the ground!



Wed, 18 Jun 1902 08:00:00 GMT  
 Encrypt/Decrypt

Quote:

>                                  String::  Hello and Good morning.
>                    Encrypted Str::::  Jgnnq cpf Iqqf oqtpkpi.

>    This encryption does not alter nothing but the alphabetic
>characters.
>Can someone give me a hand getting this off the ground, so to speak.

Read a line from the text file into a string.
Skip through the string and increment each alpha char by two (hint: Succ)
Wash, rinse and repeat.

--
Robert B. Clark
Visit ClarkWehyr Enterprises On-Line at http://www.iquest.net/~rclark/ClarkWehyr.html



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Encrypting/Decrypting

2. Encrypt\Decrypt help...

3. Encrypt\Decrypt HELP...

4. Encrypt/Decrypt Procedure

5. Encrypting /Decrypting ...

6. Encrypting and decrypting data

7. wanted: enc/decrypt programme

8. Encrypting text stored in inidividual database records

9. Using ADO with Encrypted/Password Protected Access databases

10. Encrypting TClientDataSet field values

11. using encrypted access database

12. Encrypting Program with PDOX tables

 

 
Powered by phpBB® Forum Software