Signature creation algorithm