A Python implementation providing educational functionality for:
- Monster Group: The largest sporadic simple group and monstrous moonshine
- Elliptic Curve Cryptography (ECC): Modern cryptographic protocols using elliptic curves
The Monster group is:
- The largest sporadic simple group
- Has order approximately 8×10^53
- Contains 194 conjugacy classes
- Connected to moonshine theory and the j-invariant
- First constructed by Griess in 1980
This repository provides an educational implementation focused on:
- Understanding Monster group properties and structure
- Learning about sporadic groups and their characteristics
- Exploring mathematical concepts related to the Monster group
For serious computational work with the Monster group, use the professional mmgroup library:
# Professional computational implementation
from mmgroup import MM, MMVector
# Create actual Monster group elements
g1 = MM('x', 0x123) # Real group element
g2 = MM('y', 0x456) # Another element
product = g1 * g2 # Actual group multiplication
# Work with 196884-dimensional representation
v = MMVector(15) # Vector in representation space
result = v * g1 # Group action on vectorThis repository provides conceptual understanding:
# Educational/conceptual implementation
from monster_group import MonsterGroup, MonsterElement
monster = MonsterGroup()
print(f"Order: {monster.order:,}") # Learn about group order
print(f"Prime factors: {monster.get_factorization()}") # Understand structure
identity = MonsterElement("e") # Conceptual elementsMonsterGroupclass with mathematical properties and structure informationMonsterElementclass for conceptual representation of group elements- Prime factorization of the group order
- Information about maximal subgroups and conjugacy classes
- Character table properties and moonshine connections
- Verification utilities and educational demonstrations
from monster_group import MonsterGroup, MonsterElement, demonstrate_monster_group
# Create Monster group instance
monster = MonsterGroup()
# Learn about group properties
print(f"Order: {monster.order:,}")
print(f"Is sporadic: {monster.is_sporadic()}")
print(f"Conjugacy classes: {monster.get_conjugacy_classes_count()}")
# Explore mathematical structure
factorization = monster.get_factorization()
print("Prime factorization:")
for prime, power in factorization.items():
print(f" {prime}^{power}")
# Work with conceptual elements
identity = MonsterElement("e")
print(f"Identity order: {identity.order()}")
# Run comprehensive demonstration
demonstrate_monster_group()| Feature | This Repository | mmgroup Library |
|---|---|---|
| Purpose | Educational/Learning | Computational Research |
| Group Elements | Conceptual representation | Actual computable elements |
| Operations | Property queries | Full group multiplication |
| Representations | Information only | 196884-dim computations |
| Use Case | Understanding concepts | Serious mathematical work |
| Installation | git clone |
pip install mmgroup |
-
Use this repository for:
- Learning about the Monster group structure
- Understanding sporadic groups
- Educational demonstrations
- Quick property lookups
-
Use mmgroup for:
- Computational research
- Actual group element calculations
- Vector space operations
- Advanced mathematical computations
This repository includes a comprehensive educational implementation of elliptic curve cryptography (ECC).
Elliptic Curve Cryptography is a modern public-key cryptography approach based on the algebraic structure of elliptic curves over finite fields. ECC provides:
- Smaller keys: 256-bit ECC ≈ 3072-bit RSA security
- Faster operations: More efficient than traditional RSA
- Modern applications: Bitcoin, Ethereum, TLS, SSH, Signal
- Elliptic Curve Point Arithmetic: Complete implementation of point addition and scalar multiplication
- Standard Curves: Support for secp256k1 (Bitcoin/Ethereum) and P-256 (NIST)
- ECDH: Elliptic Curve Diffie-Hellman key exchange
- ECDSA: Elliptic Curve Digital Signature Algorithm
- Educational Focus: Clear, readable code with comprehensive documentation
from elliptic_curve import EllipticCurve, ECDH, ECDSA
# Generate keypair
curve = EllipticCurve('secp256k1')
private_key = curve.generate_private_key()
public_key = curve.get_public_key(private_key)
# ECDH key exchange
ecdh = ECDH('secp256k1')
alice_private, alice_public = ecdh.generate_keypair()
bob_private, bob_public = ecdh.generate_keypair()
# Both compute same shared secret
alice_shared = ecdh.compute_shared_secret(alice_private, bob_public)
bob_shared = ecdh.compute_shared_secret(bob_private, alice_public)
assert alice_shared == bob_shared
# ECDSA signatures
ecdsa = ECDSA('secp256k1')
signing_key, verifying_key = ecdsa.generate_keypair()
message = b"Hello, ECC!"
signature = ecdsa.sign(message, signing_key)
is_valid = ecdsa.verify(message, signature, verifying_key)
print(f"Signature valid: {is_valid}")Run comprehensive examples:
python example_ecc.pyThis demonstrates:
- Basic elliptic curve operations
- Key generation
- ECDH key exchange between Alice and Bob
- ECDSA signing and verification
- Multiple curve support
- Connection to monstrous moonshine
Both modules involve elliptic curves but in different mathematical contexts:
| Aspect | Monster Group (Moonshine) | Elliptic Curve Cryptography |
|---|---|---|
| Elliptic Curves | Complex curves, modular forms | Curves over finite fields |
| j-Invariant | Fourier coefficients relate to Monster dimensions | Classifies elliptic curves |
| Application | Pure mathematics, representation theory | Applied cryptography |
| Key Result | Monstrous moonshine conjecture | Elliptic Curve Discrete Log Problem |
The j-invariant appears in both:
- Moonshine: j-function expansion coefficients mysteriously encode Monster group character dimensions (196,884 = 196,883 + 1)
- Cryptography: j-invariant classifies isomorphism classes of elliptic curves
This deep connection shows how abstract algebra, number theory, and cryptography are intertwined!
# Test Monster group
python test_monster_group.py
# Test ECC
python test_elliptic_curve.py
# Run demonstrations
python example.py # Monster group demo
python example_ecc.py # ECC demo- mmgroup library - Professional computational implementation with actual Monster group operations
- Griess, R. L. (1982). "The Friendly Giant"
- Conway, J. H. & Norton, S. P. (1979). "Monstrous Moonshine"
- Norton, S. P. (2001). "Anatomy of the Monster"
- Koblitz, N. (1987). "Elliptic curve cryptosystems"
- Miller, V. (1986). "Use of elliptic curves in cryptography"
- NIST FIPS 186-4: Digital Signature Standard (DSS)
- SEC 2: Recommended Elliptic Curve Domain Parameters
- SafeCurves: choosing safe curves for ECC