Skip to content

KirshX07/PrimeNode_RSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ PrimeNode RSA: A Pure Logic Implementation

PrimeNode RSA is a custom implementation of the RSA (Rivestโ€“Shamirโ€“Adleman) asymmetric algorithm. This project was developed as an academic assignment to demonstrate the step-by-step process of converting plaintext into ciphertext using pure mathematical logic without relying on high-level cryptographic libraries.


๐ŸŽฏ Project Objectives

Based on the assignment requirements, this project aims to:

  • Analyze the theoretical concepts of asymmetric encryption.
  • Implement the RSA algorithm from scratch (Key Generation, Encryption, and Decryption).
  • Visualize the mathematical flow of data security.

๐Ÿ› ๏ธ Core Components

1. Introduction (History & Usage)

The RSA algorithm, named after Ron Rivest, Adi Shamir, and Leonard Adleman, was first published in 1977. It is the backbone of modern internet security, widely used for:

  • Digital Signatures: Verifying the authenticity of documents.
  • Key Exchange: Securely sharing symmetric keys over insecure channels (SSL/TLS).

2. Key Generation Process

This implementation uses the Extended Euclidean Algorithm to ensure mathematical accuracy in finding the private key.

  • Select Primes: Choose two distinct prime numbers, $p$ and $q$.
  • Compute Modulus ($n$): $n = p \times q$.
  • Compute Totient ($\phi$): $\phi(n) = (p-1) \times (q-1)$.
  • Public Key ($e$): An integer such that $1 < e < \phi(n)$ and $gcd(e, \phi(n)) = 1$.
  • Private Key ($d$): Calculated as the modular multiplicative inverse of $e$ modulo $\phi(n)$.

3. Encryption Mechanism

The encryption process converts plaintext characters into numerical values (ASCII) and applies the formula: $$C = M^e \pmod{n}$$

  • $M$: Plaintext message (numeric)
  • $e$: Public exponent
  • $n$: Modulus
  • $C$: Resulting ciphertext

4. Decryption Mechanism

The decryption process restores the original message using the private key ($d$) with the formula: $$M = C^d \pmod{n}$$ The resulting numeric values are then converted back into human-readable characters.


๐Ÿ“Š Security Analysis

Aspect Description
Strengths Extremely difficult to break due to the "Integer Factorization Problem." High reliability for secure key distribution.
Weaknesses Computationally expensive and slower than symmetric algorithms (like DES/RC4). Requires very large prime numbers (e.g., 2048-bit) to remain secure against modern hardware.

๐Ÿš€ How to Run

  1. Ensure you have Python 3.x installed.
  2. Clone this repository:
    git clone [https://github.com/KirshX07/PrimeNode_RSA.git](https://github.com/KirshX07/PrimeNode_RSA.git)
  3. Run the main script:
    python primenode_rsa.py

๐Ÿ‘ค Author Information

  • Name: Kirana Shofa Dzakiyyah
  • NIM: 25051204358
  • Course: Cryptography (Individual Assignment)

About

IMPLEMENTASI RSA FROM SCRATCH

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages