Answer the question
In order to leave comments, you need to log in
Why do public APIs use public key and secret?
I noticed that some services for authentication use the approach of giving users 2 keys instead of one: public key and secret. I can’t understand why this is necessary if, as a result, requests still go under the hood and are signed through a token, which is generated from the two previous keys. Why not throw out this extra step of generating a token, immediately generate it in the dashboard and use it? Or am I missing something?
Answer the question
In order to leave comments, you need to log in
To answer this question, you need to understand what asymmetric encryption is .
Brief explanation. Asymmetric encryption is used to securely transfer data in a known insecure environment. Using exactly symmetric encryption algorithms, both parties must agree in advance which key to use, which is potentially insecure, because this key can be intercepted and a MITM attack can be carried out either by listening or forging packets.
The most commonly used Diffie-Hellman algorithm is the simplest one. Important! In its pure form, the implementation of this algorithm is vulnerable to several types of attacks, so modified versions of it are often used.
Read about asymmetric encryption
In short, a message is encrypted using a public key. And with the help of a secret, it is decrypted. Asymmetric encryption solves the problem of handing over the key when it needs to be handed over so that no one can steal it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question