Railfence Encryption
Question:
Railfence Encryption.
Input:
rajesh
Output:
rjsaeh
program:
def enc(plain):
c1=''
c2=''
for i in range(0,len(plain),2):
c1+=plain[i]
for i in range(1,len(plain),2):
c2+=plain[i]
cipher=c1+c2
return(cipher)
plain=str(input("Enter Plain Text:"))
print(enc(plain))
Railfence Encryption.
Input:
rajesh
Output:
rjsaeh
program:
def enc(plain):
c1=''
c2=''
for i in range(0,len(plain),2):
c1+=plain[i]
for i in range(1,len(plain),2):
c2+=plain[i]
cipher=c1+c2
return(cipher)
plain=str(input("Enter Plain Text:"))
print(enc(plain))
Comments
Post a Comment