Skip to content

Commit

Permalink
Warnings in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ishan-surana committed Dec 21, 2024
1 parent da81702 commit 36cdcfd
Show file tree
Hide file tree
Showing 54 changed files with 133 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
</span>

## Overview
The `cryptosystems` package offers a robust suite of classes and functions for symmetric and asymmetric encryption, hashing algorithms, key exchange protocols as well as mathematical utility functions. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Python’s built-in libraries: `ctypes`, `warnings` and `hashlib`. With almost all of the cryptographic logic implemented from scratch, `cryptosystems` provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.
The `cryptosystems` package offers a suite of classes and functions for symmetric and asymmetric encryption, hashing algorithms, key exchange protocols as well as mathematical utility functions. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Python’s built-in libraries: `ctypes`, `warnings` and `hashlib`. With almost all of the cryptographic logic implemented from scratch, `cryptosystems` provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.

> [!WARNING]
> As of now, this library stands as a personal project of mine. It has not been audited by any authority. It also contains many basic symmetric ciphers, which should be used ONLY for educational purposes, and NOT in production. The same point stands for other cryptosystems due to appropriate padding schemes not formed yet, and the project not having been formally verified. Please do not use this library in production until it is audited and certified.
## 📜 Changelog for `cryptosystems` v1.0.0 📜
- **🚀 Improved Performance with GMP 🚀:** Optimized performance using GMP for faster computations.
Expand Down
Binary file modified build/.doctrees/classical_symmetric/AdditiveCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/AffineCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/AutokeyCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/HillCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/MultiplicativeCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/PlayfairCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/VigenereCipher.doctree
Binary file not shown.
Binary file modified build/.doctrees/classical_symmetric/index.doctree
Binary file not shown.
Binary file modified build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified build/.doctrees/index.doctree
Binary file not shown.
Binary file modified build/.doctrees/introduction.doctree
Binary file not shown.
Binary file modified build/.doctrees/readme.doctree
Binary file not shown.
Binary file modified build/.doctrees/standards.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/AdditiveCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The ``AdditiveCipher`` class implements the Additive Cipher, a type of monoalpha
:param key: The integer by which each letter in the plaintext is shifted. Valid values are between 0 and 25.
:type key: int

.. attention::

AdditiveCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
-------------
The Additive Cipher (also known as the Caesar Cipher) is one of the oldest known encryption techniques. Each character in the plaintext is shifted by a fixed number of positions based on a given key. Although easy to implement, this cipher is insecure for practical use since it is easily broken by frequency analysis.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/AffineCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ The ``AffineCipher`` class implements the Affine cipher, a type of monoalphabeti
:param b: The additive key.
:type b: int

.. attention::

AffineCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
------------
The Affine cipher is a type of monoalphabetic substitution cipher. It is a combination of the Additive and Multiplicative ciphers, having two keys: one for addition and one for multiplication. Each character in the plaintext is shifted by a fixed number of positions based on the given keys, first by multiplication and then by addition. This creates a more complex encryption than either multiplicative or additive ciphers alone.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/AutokeyCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The ``AutokeyCipher`` class implements the Autokey cipher, a polyalphabetic subs
:param key: The keyword used for encryption. The key is followed by the plaintext itself for encryption.
:type key: str

.. attention::

AutokeyCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
------------
The Autokey cipher is a form of polyalphabetic substitution cipher, which means that it encrypts text by using multiple substitutions based on a keyword. It is similar to the Vigenère cipher but with an important difference: the key used for encryption is not a fixed word or phrase. Instead, the key is generated by appending the plaintext itself to the end of the keyword. This makes the cipher less vulnerable to frequency analysis, but it also introduces some weaknesses if the key is too short or predictable.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/HillCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The ``HillCipher`` class implements the Hill cipher, a polygraphic substitution
:param key_matrix: The key matrix used for encryption. Must be square and invertible modulo 26.
:type key_matrix: list of lists (2x2 or 3x3 matrix)

.. attention::

HillCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
------------
The Hill cipher is a classical polygraphic substitution cipher that encrypts blocks of text using matrix multiplication. The cipher operates on groups of letters rather than individual letters, making it more resistant to frequency analysis than traditional monoalphabetic ciphers. The encryption and decryption processes involve matrix operations with a key matrix, providing a more complex and secure method of encryption compared to simpler ciphers.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/MultiplicativeCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The ``MultiplicativeCipher`` class implements the Multiplicative Cipher, a type
:param key: The integer by which each letter in the plaintext is multiplied. The key must be coprime with 26. Valid values are between 1 and 25.
:type key: int

.. attention::

MultiplicativeCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
-------------
The Multiplicative Cipher is a variant of the Caesar Cipher, but instead of a simple shift, each letter in the plaintext is substituted by another letter in the alphabet, where the substitution is determined by multiplying the position of each letter in the alphabet by a key, and then reducing the result modulo 26. This method provides a stronger cipher compared to the Additive Cipher but is still vulnerable to frequency analysis.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/PlayfairCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The ``PlayfairCipher`` class implements the Playfair cipher, a classical digraph
Non-letter characters are ignored, and duplicates are removed.
:type key: str

.. attention::

PlayfairCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
------------
The Playfair cipher is a classical substitution cipher that encrypts pairs of letters (digraphs) rather than individual letters. It was invented by Charles Wheatstone in 1854 and was later popularized by the British during World War I. The cipher uses a 5x5 matrix containing letters of the alphabet (usually omitting 'J'). Each pair of plaintext letters is substituted with letters from the matrix according to a set specific rule.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/VigenereCipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The ``VigenèreCipher`` class implements the Vigenère cipher, a polyalphabetic
:param key: The keyword used for encryption. The keyword is repeated as necessary to match the length of the plaintext.
:type key: str

.. attention::

VigenereCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

Introduction
------------
The Vigenère cipher is a method of encrypting alphabetic text by using a keyword to generate a sequence of Caesar ciphers. Unlike the Caesar cipher, which shifts letters by a fixed number, the Vigenère cipher applies different shifts based on the letters of the keyword, making it a polyalphabetic cipher. This results in greater security compared to monoalphabetic substitution ciphers.
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/classical_symmetric/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Classical Symmetric Cryptosystems

This is the index file for the classical symmetric cryptosystems. The classical symmetric cryptosystems are implemented in the ``classical_symmetric`` submodule and can be imported directly from the package.

.. attention::

Basic symmetric ciphers should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.

--------------
Introduction
--------------
Expand Down
4 changes: 4 additions & 0 deletions build/_sources/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Welcome to the ``cryptosystems`` documentation!

The ``cryptosystems`` package offers a robust suite of classes and functions for both symmetric and asymmetric encryption, as well as hashing functionalities. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Python’s built-in libraries: ``ctypes`` and ``hashlib``. With all cryptographic logic implemented from scratch, cryptosystems provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.

.. attention::

As of now, this library stands as a personal project of mine. It has not been audited by any authority. It also contains many basic symmetric ciphers, which should be used ONLY for educational purposes, and NOT in production. The same point stands for other cryptosystems due to appropriate padding schemes not formed yet, and the project not having been formally verified. **Please do not use this library in production until it is audited and certified.**

.. note::

This project is under active development.
Expand Down
2 changes: 1 addition & 1 deletion build/_sources/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

## Overview
The `cryptosystems` package offers a robust suite of classes and functions for both symmetric and asymmetric encryption, as well as hashing functionalities. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Python’s built-in libraries: `ctypes` and `hashlib`. With all cryptographic logic implemented from scratch, cryptosystems provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.
The `cryptosystems` package offers a suite of classes and functions for both symmetric and asymmetric encryption, as well as hashing functionalities. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Python’s built-in libraries: `ctypes`, `warnings` and `hashlib`. With all cryptographic logic implemented from scratch, cryptosystems provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.

## Key Advantages
- **Dependency-Free** 🚫📦: Operates solely on Python's built-in modules, eliminating the need for external libraries.
Expand Down
6 changes: 5 additions & 1 deletion build/_sources/standards.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Standards
=========

The ``cryptosystems`` library references to the highest standards of security and cryptography, including those set forth by the **National Institute of Standards and Technology (NIST)**. This ensures that the implementation aims to follow the best established practices and recommendations for secure cryptographic algorithms, key exchange protocols, hash functions and mathematical utilities.
The ``cryptosystems`` library references the highest standards of security and cryptography, including those set forth by the **National Institute of Standards and Technology (NIST)**. This ensures that the implementation aims to follow the best established practices and recommendations for secure cryptographic algorithms, key exchange protocols, hash functions and mathematical utilities.

.. attention::

As of now, this library stands as a personal project of mine. It has **not** been audited by any authority. It also contains many basic symmetric ciphers, which should be used ONLY for educational purposes, and NOT in production. The same point stands for other cryptosystems due to appropriate padding schemes not formed yet, and the project not having been formally verified. **Please do not use this library in production until it is audited and certified.**

Below is a list of key **Federal Information Processing Standard (FIPS)** and **Special Publications (SPs)** that were referred:

Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/AdditiveCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>AdditiveCipher<a class="headerlink" href="#additivecipher" title="Link to th
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>AdditiveCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Additive Cipher (also known as the Caesar Cipher) is one of the oldest known encryption techniques. Each character in the plaintext is shifted by a fixed number of positions based on a given key. Although easy to implement, this cipher is insecure for practical use since it is easily broken by frequency analysis.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/AffineCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ <h1>AffineCipher<a class="headerlink" href="#affinecipher" title="Link to this h
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>AffineCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Affine cipher is a type of monoalphabetic substitution cipher. It is a combination of the Additive and Multiplicative ciphers, having two keys: one for addition and one for multiplication. Each character in the plaintext is shifted by a fixed number of positions based on the given keys, first by multiplication and then by addition. This creates a more complex encryption than either multiplicative or additive ciphers alone.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/AutokeyCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>AutokeyCipher<a class="headerlink" href="#autokeycipher" title="Link to this
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>AutokeyCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Autokey cipher is a form of polyalphabetic substitution cipher, which means that it encrypts text by using multiple substitutions based on a keyword. It is similar to the Vigenère cipher but with an important difference: the key used for encryption is not a fixed word or phrase. Instead, the key is generated by appending the plaintext itself to the end of the keyword. This makes the cipher less vulnerable to frequency analysis, but it also introduces some weaknesses if the key is too short or predictable.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/HillCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>HillCipher<a class="headerlink" href="#hillcipher" title="Link to this headi
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>HillCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Hill cipher is a classical polygraphic substitution cipher that encrypts blocks of text using matrix multiplication. The cipher operates on groups of letters rather than individual letters, making it more resistant to frequency analysis than traditional monoalphabetic ciphers. The encryption and decryption processes involve matrix operations with a key matrix, providing a more complex and secure method of encryption compared to simpler ciphers.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/MultiplicativeCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>MultiplicativeCipher<a class="headerlink" href="#multiplicativecipher" title
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>MultiplicativeCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Multiplicative Cipher is a variant of the Caesar Cipher, but instead of a simple shift, each letter in the plaintext is substituted by another letter in the alphabet, where the substitution is determined by multiplying the position of each letter in the alphabet by a key, and then reducing the result modulo 26. This method provides a stronger cipher compared to the Additive Cipher but is still vulnerable to frequency analysis.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/PlayfairCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>PlayfairCipher<a class="headerlink" href="#playfaircipher" title="Link to th
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>PlayfairCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Playfair cipher is a classical substitution cipher that encrypts pairs of letters (digraphs) rather than individual letters. It was invented by Charles Wheatstone in 1854 and was later popularized by the British during World War I. The cipher uses a 5x5 matrix containing letters of the alphabet (usually omitting ‘J’). Each pair of plaintext letters is substituted with letters from the matrix according to a set specific rule.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/VigenereCipher.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ <h1>VigenèreCipher<a class="headerlink" href="#vigenerecipher" title="Link to t
</dl>
</dd></dl>

<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>VigenereCipher is a basic symmetric cipher, which should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>The Vigenère cipher is a method of encrypting alphabetic text by using a keyword to generate a sequence of Caesar ciphers. Unlike the Caesar cipher, which shifts letters by a fixed number, the Vigenère cipher applies different shifts based on the letters of the keyword, making it a polyalphabetic cipher. This results in greater security compared to monoalphabetic substitution ciphers.</p>
Expand Down
4 changes: 4 additions & 0 deletions build/classical_symmetric/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ <h2> Contents </h2>
<section id="classical-symmetric-cryptosystems">
<h1>Classical Symmetric Cryptosystems<a class="headerlink" href="#classical-symmetric-cryptosystems" title="Link to this heading">#</a></h1>
<p>This is the index file for the classical symmetric cryptosystems. The classical symmetric cryptosystems are implemented in the <code class="docutils literal notranslate"><span class="pre">classical_symmetric</span></code> submodule and can be imported directly from the package.</p>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>Basic symmetric ciphers should be used ONLY for educational purposes, and NOT in production. Proceed accordingly.</p>
</div>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2>
<p>Classical symmetric cryptosystems are the oldest form of encryption systems. They are based on the concept of a shared secret key between the sender and the receiver. The key is used to encrypt and decrypt the message. The classical symmetric cryptosystems are computationally inexpensive and generally faster than the modern asymmetric cryptosystems, but they have the disadvantage of requiring the sender and the receiver to share the secret key. If the key is compromised, the security of the system is compromised. The basic types of classical symmetric cryptosystems are:</p>
Expand Down
Loading

0 comments on commit 36cdcfd

Please sign in to comment.