This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: oddString = cipherText[:len(cipherText)//2] evenString = cipherText[len(cipherText)//2:] plainText = '' for i in range(len(cipherText)//2): plainText = plainText + oddString[i] plainText = plainText + evenString[i] if len(evenString) < len(oddString): plainText = plainText + oddString[-1] return plainText def asciiEqual(): for i in range (700): acc = 0 for ch in str(i): ord(ch) acc = acc + ord(ch) if acc == i: return str (i) def subEncrypt ( plainText, key): alphabet = "abcdefghijklmnopqrstuvwxyz1234567890" plainText = plainText.replace (" ", "").lower() cipherText = "" for ch in plainText: idx = alphabet.find(ch) cipherText = cipherText + key[idx] return cipherText...
View Full Document
This note was uploaded on 04/26/2011 for the course CPS 324 taught by Professor Safa during the Spring '11 term at Dickinson.
- Spring '11