The sign() method creates a digital signature for the provided input data and returns it as a string. Digital signatures provide authentication and integrity verification - they prove the data came from a trusted source and hasn't been modified. Unlike encryption (which hides data) or hashing (one-way), signatures are verifiable: anyone can validate the signature using the signer's public key.