Fixed code for Signature Creation and Validation