misc functions for ciphers, encryption