Here a little program in Python to Encrypt your message
The program will reverse the string that the user is providing.
To reverse the string the program will use the ASCII Table.
The program will:
- Convert all chars to lower case
- Initiate a loop in the string
- For each char that is different from a separator (” “)
- Convert the char character to ASCII code
- Calculate the differential between the ASCII Code of the Character and the ASCII Code 97 (letter a)
- Substract from 122 (letter z) the different al in the previous point
- Build the String by concatenating each char
Here is the code:
Python Code – Simple Encrypting Program
a=input("Please give me a string") a=a.lower() print(a) mychar=0 mys="" for x in a: if (x!=" "): mychar=ord(x)-97 mychar=122-mychar mys=mys+chr(mychar) else: mys=mys+" " print(mys)
Here is a small version of the Program using QT interface