Skip to content

Contain some encryption algorithms with test and production ready example code

Notifications You must be signed in to change notification settings

ganonym741/encryption-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Encryption Algorithms and Methods Overview

Based on my knowledge and industry usage, here's a comprehensive overview of encryption algorithms and methods that are commonly used:

Symmetric Encryption Algorithms

1. AES (Advanced Encryption Standard)

  • Key Sizes: 128, 192, 256 bits
  • Block Size: 128 bits
  • Usage: Most widely used symmetric encryption standard
  • Applications: File encryption, database encryption, VPNs, messaging apps
  • Strength: Considered highly secure when properly implemented

2. DES (Data Encryption Standard) / 3DES (Triple DES)

  • Key Sizes: 56 bits (DES), 168 bits (3DES)
  • Block Size: 64 bits
  • Usage: Legacy systems, financial transactions (3DES)
  • Status: DES is deprecated, 3DES being phased out

3. Blowfish

  • Key Sizes: 32-448 bits
  • Block Size: 64 bits
  • Usage: Embedded systems, password management
  • Strength: Fast but limited by small block size

4. Twofish

  • Key Sizes: 128, 192, 256 bits
  • Block Size: 128 bits
  • Usage: Alternative to AES, less common
  • Strength: Strong but slower than AES

5. ChaCha20

  • Key Size: 256 bits
  • Usage: Stream cipher, mobile applications, TLS
  • Strength: Fast, secure, resistant to timing attacks

Asymmetric (Public Key) Encryption Algorithms

1. RSA (Rivest-Shamir-Adleman)

  • Key Sizes: 1024, 2048, 4096+ bits
  • Usage: Digital signatures, key exchange, SSL/TLS certificates
  • Status: 2048-bit minimum recommended today

2. ECC (Elliptic Curve Cryptography)

  • Key Sizes: 256-521 bits (equivalent to 3072+ bit RSA)
  • Curves: P-256, P-384, P-521, Curve25519, Ed25519
  • Usage: Mobile devices, blockchain, modern TLS
  • Strength: Same security with smaller keys than RSA

3. DSA (Digital Signature Algorithm)

  • Key Sizes: 1024-3072 bits
  • Usage: Digital signatures
  • Status: Being replaced by ECDSA and EdDSA

4. ElGamal

  • Usage: Key exchange, encryption
  • Status: Less common, mostly academic use

Hash Functions

1. SHA-2 Family

  • Variants: SHA-256, SHA-384, SHA-512
  • Output Sizes: 256, 384, 512 bits
  • Usage: Digital signatures, blockchain, password hashing
  • Status: Current standard

2. SHA-3

  • Variants: SHA3-256, SHA3-384, SHA3-512
  • Usage: Alternative to SHA-2
  • Status: Modern standard, less deployed

3. MD5

  • Output Size: 128 bits
  • Status: Cryptographically broken, not for security

4. SHA-1

  • Output Size: 160 bits
  • Status: Deprecated, collision attacks demonstrated

Key Exchange Protocols

1. Diffie-Hellman (DH)

  • Usage: Key exchange, perfect forward secrecy
  • Variants: Finite field DH, Elliptic Curve DH (ECDH)

2. RSA Key Exchange

  • Usage: TLS key exchange (being phased out)

Modern Encryption Methods

1. Authenticated Encryption

  • Algorithms: AES-GCM, ChaCha20-Poly1305
  • Usage: Provides both confidentiality and integrity
  • Applications: TLS 1.3, encrypted messaging

2. Homomorphic Encryption

  • Types: Partial, Somewhat, Fully Homomorphic
  • Usage: Computation on encrypted data
  • Status: Emerging technology, performance challenges

3. Quantum-Resistant Cryptography

  • Algorithms: Lattice-based, Hash-based, Code-based
  • Status: NIST standardization in progress
  • Need: Protection against quantum computers

Most Commonly Used Today

  1. AES-256 - For symmetric encryption
  2. RSA-2048/4096 - For digital signatures and key exchange
  3. ECC (P-256, Curve25519) - For mobile and modern applications
  4. SHA-256/512 - For hashing
  5. AES-GCM/ChaCha20-Poly1305 - For authenticated encryption
  6. ECDHE - For key exchange with forward secrecy

Implementation Considerations

  • Always use well-vetted libraries rather than implementing algorithms yourself
  • Proper key management is as important as algorithm choice
  • Algorithm selection depends on use case, performance requirements, and threat model
  • Stay updated with NIST and industry recommendations
  • Consider quantum resistance for long-term security needs

Next Implementation

  • Golang Implementation
  • Rust Implementation
  • Python Implementation
  • Java Implementation

About

Contain some encryption algorithms with test and production ready example code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published