ucyph


Nameucyph JSON
Version 0.2.2 PyPI version JSON
download
home_page
SummaryA command-line tool for encrypting and decrypting strings using various ciphers
upload_time2024-01-04 15:45:20
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements pytest toml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ucyph
Encrypt and Decrypt text files from the command line using historical ciphers. 

## Installation
```bash
pip install ucyph
```

## Usage

All commands will require a **usage code** and a **text file** to encrypt/decrypt.
The **usage code** is a number that corresponds to a cipher([usage codes can be found here](#usage-codes)).
The **text file** is the file that will be encrypted/decrypted.

In addition to encrypting files, you can also use the application in **interactive mode**. To activate interactive mode, simply run the command ```ucyph``` without any arguments or with the ```-i``` flag. You will be prompted to enter a **usage code**, **text file**, and **key**(if applicable).
Interactive mode allows users to encrypt/decrypt text in the command line without having to use files.

### Examples:

#### Interactive Mode
```shell
ucyph -i
```

#### Encrypting/Decrypting Files
This command calls the ```Vigenere``` cipher with a **key** of 'password', and encrypts the text from **hello.txt** in place as an output file is not specified.
```shell
ucyph 5 hello.txt -k 'password'
```

To decrypt the text, simply add ```-d``` flag to the end of the command:
```shell
ucyph 5 hello.txt -k 'password' -d
```

This command calls the ```Playfair``` cipher with a **key** of 'password', and writes the encrypted text from **hello.txt** into **output.txt**.
```shell

ucyph 11 hello.txt -o output.txt -k password
```
Now, to decrypt the text from **output.txt**, simply add ```-d``` flag to the end of the command(note that an output file is not specified):
```shell
ucyph 11 output.txt -k password -d
```

## Usage Codes
| Cipher   | Usage Code  | Requires Key |
|----------|-------------|--------------|
| Caesar   | 3           | No           |
| Vigenere | 5           | Yes          |
| Playfair | 11          | Yes          |
| Rot-13   | 13          | No           |
| Rot-47   | 47          | No           |

## Cipher Descriptions:

### Caesar Cipher
"One of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence." - [Wikipedia article on Caesar Cipher](https://en.wikipedia.org/wiki/Caesar_cipher)

### Vigenere Cipher
"A method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar cipher, whose increment is determined by the corresponding letter of another text, the key.

For example, if the plaintext is **attacking tonight** and the key is **OCULORHINOLARINGOLOGY**, then

- the first letter a of the plaintext is shifted by 14 positions in the alphabet (because the first letter O of the key is the 14th letter of the alphabet, counting from 0), yielding o;
- the second letter t is shifted by 2 (because the second letter C of the key means 2) yielding v;
- the third letter t is shifted by 20 (U) yielding n, with wrap-around;
and so on; yielding the message **ovnlqbpvt eoeqtnh**. If the recipient of the message knows the key, they can recover the plaintext by reversing this process." - [Wikipedia article on Vigenere Cipher](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher)

### Playfair Cipher
" a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair for promoting its use.

The technique encrypts pairs of letters (bigrams or digrams), instead of single letters as in the simple substitution cipher and rather more complex Vigenère cipher systems then in use. The Playfair is thus significantly harder to break since the frequency analysis used for simple substitution ciphers does not work with it." - [Wikipedia article on Playfair Cipher](https://en.wikipedia.org/wiki/Playfair_cipher)

### Rot-13 Cipher
"ROT13 ("rotate by 13 places") is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome." - [Wikipedia article on Rot-13 Cipher](https://en.wikipedia.org/wiki/ROT13)

### Rot-47 Cipher
"ROT47 is a derivative of ROT13 which, in addition to scrambling the basic letters, also treats numbers and common symbols. The transformation is done by the same algorithm as for ROT13, except that characters are rotated by 47 places, rather than 13." - [Wikipedia article on Rot-47 Cipher](https://en.wikipedia.org/wiki/ROT13#Variants)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ucyph",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Adam Slay <adamslay11@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1a/60/9136328bb3ff191d08a929cc8685c93cfec2c1510bd8629c3752bf0d5f49/ucyph-0.2.2.tar.gz",
    "platform": null,
    "description": "# ucyph\nEncrypt and Decrypt text files from the command line using historical ciphers. \n\n## Installation\n```bash\npip install ucyph\n```\n\n## Usage\n\nAll commands will require a **usage code** and a **text file** to encrypt/decrypt.\nThe **usage code** is a number that corresponds to a cipher([usage codes can be found here](#usage-codes)).\nThe **text file** is the file that will be encrypted/decrypted.\n\nIn addition to encrypting files, you can also use the application in **interactive mode**. To activate interactive mode, simply run the command ```ucyph``` without any arguments or with the ```-i``` flag. You will be prompted to enter a **usage code**, **text file**, and **key**(if applicable).\nInteractive mode allows users to encrypt/decrypt text in the command line without having to use files.\n\n### Examples:\n\n#### Interactive Mode\n```shell\nucyph -i\n```\n\n#### Encrypting/Decrypting Files\nThis command calls the ```Vigenere``` cipher with a **key** of 'password', and encrypts the text from **hello.txt** in place as an output file is not specified.\n```shell\nucyph 5 hello.txt -k 'password'\n```\n\nTo decrypt the text, simply add ```-d``` flag to the end of the command:\n```shell\nucyph 5 hello.txt -k 'password' -d\n```\n\nThis command calls the ```Playfair``` cipher with a **key** of 'password', and writes the encrypted text from **hello.txt** into **output.txt**.\n```shell\n\nucyph 11 hello.txt -o output.txt -k password\n```\nNow, to decrypt the text from **output.txt**, simply add ```-d``` flag to the end of the command(note that an output file is not specified):\n```shell\nucyph 11 output.txt -k password -d\n```\n\n## Usage Codes\n| Cipher   | Usage Code  | Requires Key |\n|----------|-------------|--------------|\n| Caesar   | 3           | No           |\n| Vigenere | 5           | Yes          |\n| Playfair | 11          | Yes          |\n| Rot-13   | 13          | No           |\n| Rot-47   | 47          | No           |\n\n## Cipher Descriptions:\n\n### Caesar Cipher\n\"One of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.\" - [Wikipedia article on Caesar Cipher](https://en.wikipedia.org/wiki/Caesar_cipher)\n\n### Vigenere Cipher\n\"A method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar cipher, whose increment is determined by the corresponding letter of another text, the key.\n\nFor example, if the plaintext is **attacking tonight** and the key is **OCULORHINOLARINGOLOGY**, then\n\n- the first letter a of the plaintext is shifted by 14 positions in the alphabet (because the first letter O of the key is the 14th letter of the alphabet, counting from 0), yielding o;\n- the second letter t is shifted by 2 (because the second letter C of the key means 2) yielding v;\n- the third letter t is shifted by 20 (U) yielding n, with wrap-around;\nand so on; yielding the message **ovnlqbpvt eoeqtnh**. If the recipient of the message knows the key, they can recover the plaintext by reversing this process.\" - [Wikipedia article on Vigenere Cipher](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher)\n\n### Playfair Cipher\n\" a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair for promoting its use.\n\nThe technique encrypts pairs of letters (bigrams or digrams), instead of single letters as in the simple substitution cipher and rather more complex Vigen\u00e8re cipher systems then in use. The Playfair is thus significantly harder to break since the frequency analysis used for simple substitution ciphers does not work with it.\" - [Wikipedia article on Playfair Cipher](https://en.wikipedia.org/wiki/Playfair_cipher)\n\n### Rot-13 Cipher\n\"ROT13 (\"rotate by 13 places\") is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome.\" - [Wikipedia article on Rot-13 Cipher](https://en.wikipedia.org/wiki/ROT13)\n\n### Rot-47 Cipher\n\"ROT47 is a derivative of ROT13 which, in addition to scrambling the basic letters, also treats numbers and common symbols. The transformation is done by the same algorithm as for ROT13, except that characters are rotated by 47 places, rather than 13.\" - [Wikipedia article on Rot-47 Cipher](https://en.wikipedia.org/wiki/ROT13#Variants)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A command-line tool for encrypting and decrypting strings using various ciphers",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/AdamSlay/ucyph"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9fd78a4b1c49acafb4770c34a7e8c710da844b046df2cd76cc86192471bae7d",
                "md5": "5a0fa6c80ebeefcd0ae097b40d959d54",
                "sha256": "38e81296985ff5c8b95c08c8942333621c51f186352b5f07e5f9733c739f1d91"
            },
            "downloads": -1,
            "filename": "ucyph-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a0fa6c80ebeefcd0ae097b40d959d54",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9450,
            "upload_time": "2024-01-04T15:45:18",
            "upload_time_iso_8601": "2024-01-04T15:45:18.086006Z",
            "url": "https://files.pythonhosted.org/packages/c9/fd/78a4b1c49acafb4770c34a7e8c710da844b046df2cd76cc86192471bae7d/ucyph-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a609136328bb3ff191d08a929cc8685c93cfec2c1510bd8629c3752bf0d5f49",
                "md5": "65251725a84a65e4f80af7de1a5ebb87",
                "sha256": "6ad888a160db4228d752016d5900c6db8818a6a8121d19ea45775af016ffa3b7"
            },
            "downloads": -1,
            "filename": "ucyph-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "65251725a84a65e4f80af7de1a5ebb87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10851,
            "upload_time": "2024-01-04T15:45:20",
            "upload_time_iso_8601": "2024-01-04T15:45:20.438173Z",
            "url": "https://files.pythonhosted.org/packages/1a/60/9136328bb3ff191d08a929cc8685c93cfec2c1510bd8629c3752bf0d5f49/ucyph-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-04 15:45:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AdamSlay",
    "github_project": "ucyph",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    "~=",
                    "7.2.0"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": [
                [
                    "~=",
                    "0.10.2"
                ]
            ]
        }
    ],
    "lcname": "ucyph"
}
        
Elapsed time: 0.16669s