Can Ethereum's public key push out its private key
This question is very strange. I recommend you to see the introction of professional media
generally speaking, the public key is used for encryption ~ the private key is used for decryption ~
the private key is public, which is used in the client ~ and the public key is confidential ~
for example ~
a serial number 5 can be obtained from the user name a and public key 3, The serial number 5 can be decrypted into a,
in this way, it is easy to verify the legitimacy of the serial number, and will not lose the Secret ~
the determination of 3 and 2 is done by some special functions. There is a certain relationship between them. 3 can easily dece 2, but 2 can hardly dece 3 ~
this is the general meaning~
encryption is to encrypt data, so that even if illegal users get encrypted data, they can not get the correct data content, so data encryption can protect data and prevent monitoring attacks. It focuses on the security of data. Identity authentication is used to judge the authenticity of an identity. After the identity is confirmed, the system can give different permissions according to different identities. It focuses on the authenticity of users. The emphasis of the two is different< Secondly, we need to understand the concept and function of public key and private key
in the modern cryptosystem, encryption and decryption use different keys (public key), that is, asymmetric key cryptosystem. Each communication party needs two keys, namely public key and private key, which can be used to encrypt and decrypt each other. The public key is public and does not need to be kept secret, while the private key is held by the indivial himself and must be kept and kept secret. Principle of public key and private key: one public key corresponds to one private key. Key pair, let everyone know is the public key, do not tell you, only their own know, is the private key. If one of the keys is used to encrypt data, only the corresponding key can be decrypted. If one of the keys can be used to decrypt data, the data must be encrypted by the corresponding key.
First of all, cracking RSA means ciphertext - & gt; The process of plaintext
Suppose plaintext m, ciphertext C, private key D, public key e, RSA encryption process is as follows:1, two large mutually unequal prime numbers P and Q
2, n = P * q
3, FN = (P - 1) * (Q - 1)
4, e and FN are mutually prime, and 1 & lt; e < FN
5, D satisfies de% FN = 1
6, encryption and decryption:
C = (m ^ E)% n
m = (C ^ D)% n
the above formula can be understood as encryption by public key and decryption by private key
the first case : the plaintext and public key are known to get the ciphertext encrypted by the private key. This is the encryption process, which has little to do with the private key D. the encryption process mainly depends on the value of n
suppose that there are countless kinds of plaintext m, public key e, private key D and ciphertext C
in the second case, : the private key is obtained by knowing the plaintext ciphertext and public key
given plaintext m, ciphertext C and public key e, find private key D, and insert the secondary formula: C = (m ^ E)% N, the value of n is not unique, so the value of private key D is not unique
when there are correct answers for comparison, I feel that the second situation is easier to find out
personal opinions, welcome to discuss
why don't we encapsulate these tedious and error prone things to simplify our development
so we have all kinds of development packages, all kinds of architectures, all kinds of libraries
in Java
keypairgenerator keygen = keypairgenerator. GetInstance (& quot; RSA");< br />KeyPair key = keyGen.generateKeyPair(); < br /> cipher.init(Cipher.ENCRYPT_ MODE, key.getPublic());< br /> cipher.init(Cipher.DECRYPT_ MODE, key.getPrivate());
this is a fragment of the code I wrote before. It is not continuous. In general, I get a RSA key pair and then call getpublic ()
getprivatekey () to get the public and private key.
7. The sunshine of youth laughs and dances a happy beat for the day that belongs to you. Happy birthday to you
8. That year and today, you were born with your little fist in your hand, and the world was glorified by you; Today, you are waving your big hand and laughing. Life is happy because of you. I feel very lucky to have a son like you. Happy 17th birthday
9. May your 17th birthday be filled with endless happiness, may your memories today be warm, may all your dreams be sweet, may the people you love be happy, and may the people who love you be healthy and happy
10, 17 years old, what a wonderful age, you not only have a tall and strong appearance, but also graally mature in the heart, we can feel your independence and strength
11. I would like to be like that maple leaf, stretching my pure light blue in the morning wind, burning my bright red in the sunset, to present your birthday
12. This season's flowers are blooming very delicate. You know, it's because I'm watering them with emotion. I'm just waiting for your birthday to present them to you. I hope you like them. May all happiness be with you. Looking up is spring and looking down is autumn; May all the joys follow you. The full moon is a poem and the moon is a picture! Happy birthday
13. Today is your 17th birthday, but I haven't been able to accompany you. However, my blessing has already passed thousands of rivers and mountains, and I don't need to express my heart face to face. Send a short message to convey my sincere blessing! Happy 17th birthday
14. The hot tea can warm the body, the passionate stories can move the heart, and the blessings can convey my feelings. Today is your 17th birthday. I wish you happiness and company
15. Fly bravely! Fly as high as you can! Fly as far as you can! Mom will take down the rope that is holding you down and let you fly freely! Let you fly happily
16. The background light shines on your cheek. Although it is weak, it can extend far away. After reading this news, make a wish to let the stars all over the sky bless you
17. Everyone will be 17 years old and become an alt. We should work harder and rely on our own hands to support ourselves
18. Flowers are similar year by year, but people are different year by year. I want to be born in the future, but I don't know it. Ask is happy or sad, everyone said happy. In this annual samsara of all things day, I wish you a happy 17th birthday, good fortune, longevity
19. The fish are happy because of the river, and the flowers are blooming because of the sunshine; Birds fly in the sky, I am happy because of you. On this special day, I wish you a very happy 17th birthday, health and happiness every day
20. When sugar and water meet, they dissolve faster; Mountains and water connected, the beauty is more beautiful; You and I are interlinked in heart and family; I always remember your 17th birthday in my heart. I wish you a happy 17th birthday
21. Although the road between the two places is far away, friendship is closely linked. Today is your 17th birthday, keep it in mind; No matter have busy, wish can't forget; I wish you a prosperous career, a smooth love, a happy life and a happy 17th birthday
22. Candlelight, cake fragrance, happy wine and childhood fun. I wish you a happy 17th birthday song. I'll wave my hand today and get together again on the same day next year.
