Working version (cipher)