Transposition Cipher Encryption and Decyption with Python

def entrans(p,k):
c=”
b=len(p)
while b%k>0:
p=p+’x’
b=len(p)
n=b//k
for i in range(k):
for j in range(n):
c=c+p[i+j*k]
return c

def detrans(c,k):
b=len(c)
k=b//k
p=”
n=b//k
for i in range(k):
for j in range(n):
p=p+c[i+j*k]
return p

Penjelasan ada di Channel Youtube saya

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to toolbar