Skip to content

Instantly share code, notes, and snippets.

@mouadkhiat
mouadkhiat / vigenere.py
Created August 9, 2019 23:55
The Vigenère Cipher Encryption and Decryption - Python
######## Made By Mouad Khiat
######## This script is the Famous Vigenere cipher its like caesar that ive made in the previous gist
######## but the difference is that we deal here with letters not numbers
######## So with this script you can encrypt anything you want with your given key , decrypt it either with a key or a part of it
######## or by guessing
from random import sample
from itertools import product as col
@mouadkhiat
mouadkhiat / caesar.py
Last active February 20, 2024 13:26
Caesar Cipher Python [Encrypt / Decrypt]
############ Made By Mouad KHIAT / Python 3.7
############ if you have another idea to write this famous cipher put it in the comment
############ It's started with DOHD MDFWD HVW ==> ALEA JACTA EST (key = 3)
def transform(x):
x = list(x)
for i,n in enumerate(x):
if n in ABC:
x[i] = ABC.index(n)
return x
def crypt(x,key):