Simple Encryption and Decryption Python

Date:

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

Amarendra
Amarendra
Stock Trader, SEO, Music Producer

Leave a reply

Please enter your comment!
Please enter your name here

Share post:

Subscribe

Popular

More like this
Related

Tango Live: Free Guide to Exclusive Features and Benefits

IntroductionWelcome to our comprehensive guide on Tango Live, the...

How to Setup SailPoint and Manage IdentityIQ with Compass

Introduction to SailPoint Technology and SailPoint Compass: A Comprehensive...

XXVI Video Player – Exclusive Multimedia Companion

Introduction to XXVI Video PlayerDownload XXVI Video Player, Link...

How to Use Telegram Web Login for Windows and Mac

Telegram Web Login: A Comprehensive How to GuideTelegram is...