Skip to main content
This project implements three classic cryptographic algorithms, each representing different approaches to encryption: substitution, transposition, and asymmetric cryptography.

Available algorithms

Caesar cipher

Substitution cipher that shifts letters by a fixed position

Transposition cipher

Rearranges message letters using a columnar transposition matrix

RSA encryption

Asymmetric encryption using public and private key pairs

Comparison table

FeatureCaesarTranspositionRSA
TypeSubstitutionTranspositionAsymmetric
Key typeSingle integer (shift)Column countPublic/private key pair
Default key8 positions5 columns32-bit keys
Alphabet supportSpanish (A-Z + Ñ)Any charactersASCII characters
ComplexityVery lowLowHigh
Security levelEducational onlyEducational onlyEducational only
Output formatTextTextArray of numbers

Security considerations

All three algorithms in this project are implemented for educational purposes only and should never be used for real-world encryption.

Why these implementations are not secure

  • Only 27 possible keys (easily brute-forced)
  • Vulnerable to frequency analysis
  • No protection against known-plaintext attacks
  • Trivial computational complexity to break
  • Does not hide letter frequencies
  • Vulnerable to anagramming attacks
  • Pattern analysis can reveal the key
  • No protection for short messages
  • 32-bit keys are extremely weak (can be factored in seconds)
  • No padding scheme (vulnerable to various attacks)
  • No salt or randomization
  • Simple prime generation without cryptographic guarantees
  • Production RSA uses 2048+ bit keys minimum
For production cryptography, use established libraries like cryptography or pycryptodome that implement modern, secure algorithms with proper key sizes and security measures.

Choosing an algorithm

For learning purposes

Best for beginnersThe Caesar cipher is the simplest to understand and implement. It’s perfect for:
  • Understanding basic encryption concepts
  • Learning about modular arithmetic
  • Exploring frequency analysis attacks
  • First steps in cryptography

Common features

All three algorithms in this project share:
  • Encrypt and decrypt functions: Each algorithm provides bidirectional operations
  • Key-based encryption: All require a key (shift, column count, or key pair)
  • Python implementation: Pure Python code without external crypto libraries
  • CLI and web interface: Available through main.py (console) or app.py (Flask)
  • Spanish language support: Caesar cipher includes the Ñ character

Next steps

1

Explore individual algorithms

Read the detailed documentation for each algorithm to understand how they work
2

Try the examples

Use the provided code examples to encrypt and decrypt messages
3

Experiment with parameters

Change keys, message lengths, and observe the behavior
4

Learn about attacks

Research how each algorithm can be broken to understand security principles

Build docs developers (and LLMs) love