def crypt(self, key): key = Key(key) stringCrypted = list(self.clearString) #Loop on all upper characters in the string to crypt for c in str.upper(self.clearString): stringCrypted[key.getKeyIndex()] = self.encodeCharacter(c, key) key.incrementKeyIndex() return stringCrypted