def decrypt(self,ciphertext): key = self.key ciphertext = cryptutils.convertInput(ciphertext,['upper','nospaces','charonly']) plaintext = [] for i in range(0,len(ciphertext)): ch = ciphertext[i] plaintext.append(cryptutils.rotateChar(ch,key,direction='backward')) return ''.join(plaintext)
def encrypt(self,message): key = self.key message = cryptutils.convertInput(message,['upper','nospaces','charonly']) outmessage = [] for i in range(0,len(message)): ch = message[i] outmessage.append(cryptutils.rotateChar(ch,key)) return ''.join(outmessage)
def encrypt(self, message): key = self.key message = cryptutils.convertInput(message, ['upper', 'nospaces', 'charonly']) outmessage = [] for i in range(0, len(message)): ch = message[i] outmessage.append(cryptutils.rotateChar(ch, key)) return ''.join(outmessage)
def decrypt(self, ciphertext): key = self.key ciphertext = cryptutils.convertInput(ciphertext, ['upper', 'nospaces', 'charonly']) plaintext = [] for i in range(0, len(ciphertext)): ch = ciphertext[i] plaintext.append( cryptutils.rotateChar(ch, key, direction='backward')) return ''.join(plaintext)