Share a cryptography Example:
Let's say that our protagonist is Alice and Bob, they are going out for dinner, but there is no consensus on which restaurant to go to. At this point the usual solution is to scissors, coins and other means to decide who to choose the scheme. This is usually fair and reasonable, like a coin toss on a football field (the probability is half the way).
But the same thing is likely to fail if the environment changes. For example, if Alice is having dinner with Bob on the phone or on the internet, if they don't have a favorite restaurant, it's obviously inappropriate to still use scissors or coin-throwing. Because there may be cheating, and no notary can be notarized truth! The transmission of modern network data has a similarly troubling problem.
What we need at this point is a protocol that can be considered a game rule, and we need to use encryption if the game is online or offsite.
Here we assume:
There is a number α, which can be easily obtained by a series of operations of α, that is, β=f (α), and it is almost impossible to calculate α by β (using supercomputers for 100 years to produce results)
Application implementation:
1. Alice and Bob now agree, by Bob Coin and select a random alpha (alpha for the odd number of coins to the positive, α is even to the negative coin) when and after the operation of the result (Beta) to tell Alice.
2.Alice tells Bob himself about the positive and negative guesses (that is, odd-even guesses): the probability is 50%.
3.Bob tells Aliceα the value.
4.Alice validates F (α) =β by operation.
Such examples have become the cornerstone of data security communications in the development of modern networks. Nowadays, many cryptographic algorithms are implemented by the operation principle of this kind of irreversible function.
Cryptography involves many aspects, such as data encryption, authentication, data integrity, and so on. These are just a few examples of data communication protocols and encryption, and many details are not mentioned and require you to make less use of a programming language to implement her.