updated codes..few issues exists on receiving ciphertext from C