{"id":20742985,"url":"https://github.com/pandh4cker/pyransom","last_synced_at":"2025-10-10T03:32:36.474Z","repository":{"id":107313640,"uuid":"455652713","full_name":"PandH4cker/pyRansom","owner":"PandH4cker","description":"Encrypt/Decrypt Symmetrically/Asymmetrically files with Integrity verification using signature","archived":false,"fork":false,"pushed_at":"2022-02-22T16:15:46.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T03:32:30.123Z","etag":null,"topics":["aes-256","argparse","asymmetric-encryption","cbc-aes-encryption","hmac-sha256","initialization-vector","multi-protection","oaep","pss","pycryptodome","python3","rsa","rsa-signature","signature","symmetric-encryption"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PandH4cker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-04T18:21:03.000Z","updated_at":"2025-04-22T10:26:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"98f1a50e-9174-4d5b-bd39-ba4c20887f0e","html_url":"https://github.com/PandH4cker/pyRansom","commit_stats":null,"previous_names":["pandh4cker/pyransom","mrrraph/pyransom"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PandH4cker/pyRansom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandH4cker%2FpyRansom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandH4cker%2FpyRansom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandH4cker%2FpyRansom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandH4cker%2FpyRansom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PandH4cker","download_url":"https://codeload.github.com/PandH4cker/pyRansom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PandH4cker%2FpyRansom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002624,"owners_count":26083425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-256","argparse","asymmetric-encryption","cbc-aes-encryption","hmac-sha256","initialization-vector","multi-protection","oaep","pss","pycryptodome","python3","rsa","rsa-signature","signature","symmetric-encryption"],"created_at":"2024-11-17T07:08:35.111Z","updated_at":"2025-10-10T03:32:36.449Z","avatar_url":"https://github.com/PandH4cker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyRansom\n## Author: [Raphael Dray](https://www.linkedin.com/in/raphaeldray/)\npyRansom is not a ransomware but a tool designed to encrypt/decrypt \nusing either symmetrically either asymmetrically a given file and checking\nits integrity using either [HMAC-SHA-256](https://fr.wikipedia.org/wiki/HMAC) \neither [RSA-PSS signature](https://en.wikipedia.org/wiki/Probabilistic_signature_scheme).\n\nIt can be used, for now, to encrypt/decrypt symmetrically using \n[AES](https://fr.wikipedia.org/wiki/Advanced_Encryption_Standard)\n-256-[CBC](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_block_chaining_(CBC))\nwith a given password that will be used to generate round keys.\n\nAlso, it can be used to encrypt/decrypt asymmetrically using \n[RSA-OAEP](https://fr.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding) 2048\nto encrypt only the CipherKey (used by the AES to encrypt data)\nin case of single user sending and to encrypt the CipherKey plus \nthe \n[Initialization Vector](https://en.wikipedia.org/wiki/Initialization_vector#:~:text=In%20cryptography%2C%20an%20initialization%20vector,to%20be%20unpredictable%20or%20unique.) \n(used by the AES to encrypt data) in case\nof multi-protect sending.\n\n---\n### Installation:\nYou'll need [Python 3.8+](https://www.python.org/downloads/) to run this script.\n* Clone this repository:\n    ```shell\n    git clone git@github.com:MrrRaph/pyRansom.git\n    ```\n* Install the requirements:\n    ```shell\n    pip install -r requirements.txt\n    ```\n\n---\n### Usage:\n#### General Options:\n```\nusage: pyRansom.py [-h] --input \u003cInput Filename\u003e --output \u003cOutput Filename\u003e (--encrypt | --decrypt) {sym,asym} ...\n\nEncrypt/Decrypt given file\n\npositional arguments:\n  {sym,asym}            Encryption Mode\n    sym                 Symmetric Mode\n    asym                Asymmetric Mode\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nI/O:\n  --input \u003cInput Filename\u003e, -i \u003cInput Filename\u003e\n                        Input file to Encrypt/Decrypt\n  --output \u003cOutput Filename\u003e, -o \u003cOutput Filename\u003e\n                        Output file to save the encrypted/decrypted\n\nCipher Mode:\n  --encrypt, -e         Encrypt mode\n  --decrypt, -d         Decrypt mode\n```\n---\n#### Symmetric Encryption:\n```\nusage: pyRansom.py sym [-h] --password \u003cPassword\u003e\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nSymmetric Encryption:\n  --password \u003cPassword\u003e, -p \u003cPassword\u003e\n                        Password to be used to encrypt/decrypt the file\n```\n\n**Example:**\nStart by encrypting your Input File using your password (e.g. myP@$$W0rd)\n```shell\npython pyRansom.py -e --input venv\\Scripts\\activate.fish --output output\\activate.fish.enc sym -p myP@$$W0rd\n```\n\nThen you can decrypt your Output File as follows:\n```shell\npython pyRansom.py -d --input output\\activate.fish.enc --output output\\activate.fish.dec sym -p myP@$$W0rd\n```\n---\n#### Asymmetric Encryption:\n```\nusage: pyRansom.py asym [-h] --private-key \u003cPrivate Key Filename\u003e --public-key \u003cPublic Key Filename\u003e [\u003cUser Public Key\u003e [\u003cUser Public Key\u003e ...]]\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nAsymmetric Encryption:\n  --private-key \u003cPrivate Key Filename\u003e, -priv \u003cPrivate Key Filename\u003e\n                        Receiver/Sender Private Key\n  --public-key \u003cPublic Key Filename\u003e, -pub \u003cPublic Key Filename\u003e\n                        Receiver/Sender Public Key\n  \u003cUser Public Key\u003e     User Public Key (Multi-Protected File)\n```\n\n##### Single Sending:\nFor encryption, you have to use the sender private key and the receiver public key.\n```shell\npython pyRansom.py -e --input venv\\Scripts\\activate.fish --output output\\activate.fish.enc asym -priv senderPriv.pem -pub receiverPub.pem\n```\n\nFor decryption, you have to use the receiver private key and the sender public key.\n```shell\npython pyRansom.py -d --input output\\activate.fish.enc --output output\\activate.fish.dec asym -priv receiverPriv.pem -pub senderPub.pem\n```\n\n---\n##### Multi-Protect Sending:\nFor encryption, you have to use the sender private key and the sender public key.\nThen you can specify all the receivers public keys, only those could decrypt the file.\n```shell\npython pyRansom.py -e --input venv\\Scripts\\activate.fish --output output\\activate.fish.enc asym -priv senderPriv.pem -pub senderPub.pem users\\Thierry\\thierry-pub.pem users\\Lorens\\lorens-pub.pem\n```\n\n_Or by using the wrapper_:\n```shell\npython multi_protect.py -e venv\\Scripts\\activate.fish output\\activate.fish.enc senderPriv.pem senderPub.pem  users\\Thierry\\thierry-pub.pem users\\Lorens\\lorens-pub.pem\n```\n\nFor decryption, for example, Thierry as the receiver, will use its own private key, \nthe sender public key and specify its public key.\n```shell\npython pyRansom.py -d --input output\\activate.fish.enc --output output\\activate.fish.dec asym -priv users\\Thierry\\thierry-priv.pem -pub senderPub.pem users\\Thierry\\thierry-pub.pem\n```\n\n_Or by using the wrapper_:\n```shell\npython multi_protect.py -d output\\activate.fish.enc output\\activate.fish.dec users\\Thierry\\thierry-priv.pem senderPub.pem users\\Thierry\\thierry-pub.pem\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandh4cker%2Fpyransom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandh4cker%2Fpyransom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandh4cker%2Fpyransom/lists"}