Simple Encryption and Decryption Python

Simple example of encryption text

simple encryption.py

# Sample Python/Pygame Programs
# http://simpson.edu/computer-science/
 
plain_text = "This is a test. ABC abc"

encrypted_text = ""
for c in plain_text:
    x = ord(c)
    x = x + 1
    c2 = chr(x)
    encrypted_text = encrypted_text + c2
print(encrypted_text)

Simple example of decryption text

simple decryption.py

# Simpson College Computer Science
# http://simpson.edu/computer-science/
 
encrypted_text = "Uijt!jt!b!uftu/!BCD!bcd"
 
plain_text = ""
for c in encrypted_text:
    x = ord(c)
    x = x - 1
    c2 = chr(x)
    plain_text = plain_text + c2
print(plain_text)

 

source,source,edu

Subscribe

Related articles

There is brand-new Xiaomi Wireless AR Smart Glasses

Xiaomi, the Chinese multinational electronics company, has recently launched...

The OnePlus 11R has been revealed to use a Snapdragon 8+ Gen 1 processor

OnePlus is having a big event on February 7, where...

Zoom Lays Off 1,300 Employees: A Look at the Impact and Reactions

Zoom, the popular video conferencing platform, has recently announced...

The Future of Bitcoin and Cryptocurrency Outlook in 2023

Bitcoin and cryptocurrency have come a long way since...
Amarendra Singh
Amarendra Singh
Stock Trader, SEO, Music Producer

Leave a reply

Please enter your comment!
Please enter your name here