0

I'm trying to explore some encryption types in python. Could anyone provide me with some beginner encryption code? Thanks for any help. I've already tried changing the length of the message, but that didn't work. Please help!

Matthew Mellea
  • 89
  • 1
  • 10

2 Answers2

3

Hacking Ciphers is a great resource! Here is some example code.

import sys
import cmd




message = cmd.raw_input("Enter something to encypt: ")
translated = '' 

for i in range(len(message)):
    translated = translated + message[i] 
    i = i - 1 
print(translated) 

Good luck!

Torkoal
  • 457
  • 5
  • 17
1
x="hello world".encode("rot-13")
print x
print x.decode("rot-13")
Joran Beasley
  • 110,522
  • 12
  • 160
  • 179