Skip to content

cwhde/cs-RSA

Repository files navigation

Quality Gate Status Coverage Bugs Code Smells Duplicated Lines (%) Lines of Code

cs-RSA

Overview

A custom implementation of RSA encryption in C# created as part of my Matura-Project on Quantum-Computing's implications for modern cryptography. This project was built to understand RSA's inner workings through hands-on implementation.

Disclaimer

Educational Purpose Only: This is a self-implemented RSA system created for learning and experimentation. While it follows RSA principles, it has not been security-tested and should not be used in production environments. For actual security needs, please use established cryptographic libraries. I am not liable for any security issues arising from its use in sensitive applications.

Solution Structure

  • RSA: Custom implementation of RSA encryption/decryption and key generation
  • ReferenceRSA: Implementation using System.Security.Cryptography for comparison
  • RSA.commons: Shared interfaces and utilities
  • RSA.CLI: Command-line interface for demonstration
  • csRSA.Tests: Comprehensive unit tests

Current Features

  • RSA implementation with PKCS1 Padding
  • Key handling (generation, parsing) in X.509/PKCS#8 format
  • Support for various key formats (X509 String, PEM File contents, PEM File)
  • Support for various padding modes (Pkcs1, Oaep with SHA1, Oaep with SHA256)
  • Comprehensive CLI for encrypting and decrypting messages (from and to files or input), checking the algorithm against the reference implementation and working with keys (generating, reading, writing, from input)
  • Comprehensive testing suite

Technical Notes

  • Uses Big Endian for compatibility with standard RSA implementations
  • Relies on BigInteger and BouncyCastle for basic functions
  • Only supports X.509/PKCS#8 keys in the custom implementation

Learning & Validation Resources

Sources


This repository is part of the learning process for my MA (Maturaarbeit), but it is NOT an official part of the MA itself. The sources used for this project are a mix of the academic literature cited in the MA and also various additional resources (e.g., official documentation, tutorials, and community forums) that were consulted during development.

About

Writing a simple implementation of RSA in cs in order to understand it's functionality

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages