SIGNED MESSAGES ALGORITHM