GenAuth DocsDocuments
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
Concepts
  • What is GenAuth
  • What is User Pool
  • What is Application
  • What is Authentication
  • What is Federation Authentication
  • What is Zero Trust Network
  • Single Sign-On and Single Sign-Out
  • What is Authorization
  • Authentication vs Authorization
  • What is JWT Token
  • What is ID Token
  • What is Access Token
  • What is Refresh Token
  • Access Token vs Id Token
  • Understanding OIDC and OAuth2.0 Protocol

  • Understanding SAML2 Protocol

  • What is Multi-Factor Authentication
  • Account Lifecycle Management
  • Hosted Login Page vs Embeddable Login Component
  • CIAM and EIAM
  • What is LDAP
  • How QR Code Login Works
  • Basic Concepts of Cryptography
  1. Concepts
  2. /
  3. Basic Concepts of Cryptography

¶ Basic Concepts of Cryptography

Update time: 2025-04-11 11:21:15
Edit

This article describes several common concepts in cryptography: encryption, decryption, signature, signature verification, summary, encoding, public key, and private key.

¶ Encoding

Encode information, without information loss, and anyone can decode the information through encoding. For example, ASCII code, base64 encoding.

For example, the following is an ASCII encoding table:

ASCII encoding

¶ Summary

Calculate the summary value of the information, with information loss, such as md5 summary, sha1 summary.

MD5 summary

¶ Encryption

Encrypt information so that it cannot be known by the listener, without information loss. For example: AES, DES, RSA.

AES encryption

¶ Public key

The public key is two numbers, e (e = 65537, e > 1 and coprime with ø(n), ø(n) is the Euler function), n (n = p * q, p, q are prime numbers), used for signature verification or encryption. Generally speaking, we do not say that we use the public key to decrypt, but we say that we use public key to verify. For example, RSA public key.

¶ Private key

The private key is two numbers, d (e is the inverse element of ø(n), ø(n) is the Euler function), n (n = p * q, p, q are prime numbers), used for signing or decrypting. Generally speaking, we do not say that we use the private key to encrypt, but we say that we use private key to sign.

¶ Relationship between public key and private key

There is no difference in mathematics, they are both a pair of numbers, depending on which set of numbers is made public. The content encrypted by the public key must be decrypted with the private key; the content encrypted by the private key must be decrypted with the public key. The private key must be protected by yourself and must not be leaked; the public key can be made public on the Internet and anyone can use it to encrypt information. Of course, only the private key can decrypt the encrypted content.

RSA Encryption

¶ Signature

Calculate the summary value of the information, sign the summary value with the private key, and generate a signature value. The signature algorithm includes RS256, etc.

RSA + MD5 Signature

¶ Verify Signature

Use the public key to verify the signed information. After getting a piece of information and its signature value, you need to calculate the information summary value first, decrypt the signature value with the public key, and compare it with the calculated information summary value.

RSA + MD5 Verify Signature

Previous article: How QR Code Login Works
  • Encoding
  • Summary
  • Encryption
  • Public key
  • Private key
  • Relationship between public key and private key
  • Signature
  • Verify Signature

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.