I have a question about public key cryptography.

Asked 2 years ago, Updated 2 years ago, 96 views

How could you lock with a public key?
Can't you unlock it with a public key?

If you can use a public key to make a key,
Anyone can impersonate
Does that make sense as a code?

algorithm security

2022-09-29 21:50

5 Answers

May 27, 2015 Additional information

The following electronic signature statements are specific to RSA ciphers, which are public key ciphers.
Please note that it cannot be applied to public key ciphers in general.

Additional note So far

Public key encryption encrypts and decrypts using two types of keys: a public key and a private key that only you have.

Also, as a feature of the public key, data encrypted using the public key cannot be decrypted using the public key because of its unidirectional nature, and cannot be decrypted without using the private key that only you have.

However, since the essence of public key encryption is to encrypt transmissions to specific parties using a public key, it is not considered or capable of preventing them from becoming natural.

Conversely, it is a technology called electronic signature that allows data locked with the previous private key to be opened with a public key, so if the private key is not found out, it can be proved that it was sent by the only person with the private key.

Therefore, if you want to prevent impersonation from Hoge to Piyo and encrypt it and send it to Piyo,

You can perform encryption and electronic signature by following these steps.


2022-09-29 21:50

An algorithm that enables encryption with key A, decryption with key B, and decryption with key A even if it is obtained, is called public key encryption.Therefore,

Why can't I unlock it with a public key and a public key?

The answer to is, "That's what public key cryptography is all about."

You may be preventing spoofing, for any possible keys by a public key < p > that's a cipher that makes sense as < / >?

In the common key encryption system, since A and B have a common key, I think the question comes from the idea that if B decrypts what A encrypted and "correctly" decrypts it, the original ciphertext is encrypted by A.

This assumption is incorrect, and a normal encryption algorithm cannot generally determine if it was able to decrypt "correctly" (if the key used was correct).Different encryption keys and decryption keys do not result in a "different password" error, as in a ZIP file with a password, but are decrypted according to the key value.

If the original data is in a particular format (e.g., text file) and the receiver knows the plaintext value in advance, the decryption results may determine that it was "correctly" decrypted, but this is an application of cryptographic algorithms, not cryptographic algorithms themselves.

While it is true that "anyone can encrypt" is difficult to use to validate a message, it is not meaningless as a cipher.

Currently, verification of message legitimacy (whether the caller is correct or not tampered with) is done electronically.

"Introduction to Cryptography" (ISBN 4797350997) is recommended as an introduction to cryptography.


2022-09-29 21:50

If you can use a public key to make a key,
Anyone can impersonate it, right?

As for this part... I think it's probably just a mix of 'Who can prevent you from being peeked at by encryption?' and 'Guarantee of communication partners.'
The point of the word "mimasu" is to judge it as "mimasu."

The public key encryption system is a technology to create a secure communication environment with many and unspecified people, so it doesn't matter who the communication with.
By distributing the public key, the person with the secret key can safely send the information to the person with the secret key by many and unspecified number of people.If only the secret key is kept hidden so that no one knows, information encrypted with the public key can only be decoded by the person with the secret key.
This is the main premise.

For example, when I logged in to the server, I logged in with A's ID, password.The ID and password are securely sent using public key encryption.
However, A's ID and password were leaked, and B logged in to the server with A's ID and password.In other words, Mr. B impersonates Mr. A.
Whether it's Mr. A or Mr. B, the communication path can be safely communicated by public key encryption.
At this point, public key encryption is meaningful.It's helpful.
So who can stop them from trying to sneak a peek?
These are the servers that exist on the communication path.
For Windows, try tracert-d at the command prompt.You can see how many devices you are going through from your PC to the destination.You can prevent the guys in between from sneaking at you.

To be more specific...
The Internet is made up of many servers and so on.
When server A communicates to server C, it communicates through server B.
Information sent from server A to server C passes through server B.What if this server B operator is malicious?Of course, they will sneak a look at me.
So how do I safely send information from server A to server C?

Server A takes the public key that Server C publishes.
Send the public key encrypted information to server C.There is server B in the middle, but the information that arrived at server B is encrypted and cannot be read.
Encrypted information is delivered to server C.Server C has a public key and a pair of private keys, so it can be decrypted.
The information is now safely passed to server C.


2022-09-29 21:50

We were talking about the common key encryption system.Excuse me.

In the public key encryption system, you can lock it with a public key and unlock it with a private key.
If you can unlock it with a public key, encryption is meaningless because it is literally a public key and anyone can unlock it.

To give you an easy-to-understand example, there is a pair of padlocks and keys. Anyone can get a padlock and lock it, but only the person who distributed the padlock has the key.
Therefore, no matter who is locked, only the person who distributes the key can empty it.

Anyone can get a public key, so anyone can lock it, but isn't that enough to falsify it?You need to unlock it, tamper with it, and lock it again.
Third parties cannot open the lock, so they cannot tamper with it.

Also, do you mean that you are impersonating a case of registering a public key in a server login?

Login Side - A
Server side logged in -B


①A sends B data encrypted with the public key of B for random numbers.
②B combines the data sent from A, checks the contents, and sends back the random numbers sent by A and the random numbers generated by A with A's public key.
③A combines the data sent from B to verify that the random number sent by B is correct.If correct, encrypts the random number generated by B with B's public key and sends it back.
④If B confirms the data sent by A,

A is "B has B's secret key"
B is "A has A's secret key"
can be seen.


2022-09-29 21:50

In addition to the public key, the receiver (server) has a private key.
The server uses a public key and a private key to decrypt it, so it can be used as a cipher as long as the private key is not leaked.


2022-09-29 21:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.