cipher and invcipher