adding ctr for encryption