first implementation of read_ciphertext