works for cyphers smaller than 26 and needs to be refactored