Encrypt/Decrypt

Encrypt/Decrypt

Author

Message

reloa..#1 / 4

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!!!

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

Bob Scho#2 / 4

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!!!

> 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.

>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!!!

> 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()