! The different cryptocurrencies do not follow the same cryptography scheme. Below are the basics with which most cryptocurrencies work.
For a transaction to become valid, cryptocurrencies require a digital signature, which can be compared to a real signature or a fingerprint. It provides guarantee, validation and integrity of an electric document in virtual transactions, by associating the signer with the data, making sure that it is untampered. In order to do so, cryptographic keys¹ come into play.
Every account, also known as wallet, is connected to two cryptographic keys - a public and a 256 digit long private one. The 256 digit long private key is randomly picked the moment you open your wallet (but is still highly secure, due to complex algorithms). It is unique and only the owner has access to it. Losing your private key or revealing it, is like gifting a stranger your credit card including the PIN. The public key is mathematically deduced from the private key. However, it is impossible to reverse this algorithm in order to find the private key out. Also, the public key generates a users public address which acts like the number of your bank account.
But what is the function of those keys? The public key is there to receive the data, the cryptocurrency, kind of comparable to a mailbox. The private key is the actual key to this mailbox, being a requisite to decipher the encrypted data. It is also necessary for transactions, as any transaction that is made has to be signed through the private key of the sender. In addition, it generates a hash algorithm², which encrypts the data and thereby creates the digital signature. Appended to the document, the signer sends a copy of her/his public key, which the payee uses to decipher the encrypted data. After the transactions is completed, it is stored in the wallet. If this this should not work, the document can be detected as invalid. Furthermore, the document is tagged with the time of signing and can be detected as modified, if someone tries to change the data after it has been signed.
Picture resource: https://comodosslstore.com/blog/what-is-digital-signature-how-does-it-work.html
¹ cryptographic keys= string of digits that is generated by complex algorithms.
² hash algortihm = Refers to the hash function, which is used in cryptography. It is a mathematical function that takes a key, or any characters, and changes it to a another value, the hash value, which is usually shorter and represents the original data.
Key terms to remember:
-Digital signature
-Private key
-Public key
-Public address
-Encryption through hash function
Picture resource: http://www.hackbusters.com/news/stories/3070657-live-webinar-digital-transformation-best-practices-for-cryptographic-key-management-and-protection