split cipher into cipher/decipher
improve error callback behaviour