Implemented decrypt function