{"id":22058735,"url":"https://github.com/hackthissite/cryptopaste","last_synced_at":"2025-05-12T19:41:42.059Z","repository":{"id":55887914,"uuid":"89177188","full_name":"HackThisSite/CryptoPaste","owner":"HackThisSite","description":"A secure, browser-side encrypted pastebin. ","archived":false,"fork":false,"pushed_at":"2020-12-09T13:25:28.000Z","size":1439,"stargazers_count":60,"open_issues_count":1,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-09T14:27:54.716Z","etag":null,"topics":["aes","composer","cron","encryption","highlightjs","mysql","pastebin","php","sjcl","symfony"],"latest_commit_sha":null,"homepage":"https://cryptopaste.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HackThisSite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-23T22:41:04.000Z","updated_at":"2024-11-09T13:22:42.000Z","dependencies_parsed_at":"2022-08-15T08:40:35.466Z","dependency_job_id":null,"html_url":"https://github.com/HackThisSite/CryptoPaste","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackThisSite%2FCryptoPaste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackThisSite%2FCryptoPaste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackThisSite%2FCryptoPaste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackThisSite%2FCryptoPaste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HackThisSite","download_url":"https://codeload.github.com/HackThisSite/CryptoPaste/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253809380,"owners_count":21967717,"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","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","composer","cron","encryption","highlightjs","mysql","pastebin","php","sjcl","symfony"],"created_at":"2024-11-30T17:24:42.355Z","updated_at":"2025-05-12T19:41:42.031Z","avatar_url":"https://github.com/HackThisSite.png","language":"PHP","readme":"\u003cimg src=\"web/img/cryptopaste.png\" align=\"left\"\u003e\n\u003ch1\u003eCryptoPaste\u003c/h1\u003e\nA secure, browser-side encrypted pastebin.\n\n[![Build Status](https://travis-ci.org/HackThisSite/CryptoPaste.svg?branch=master)](https://travis-ci.org/HackThisSite/CryptoPaste)\n\n# About\n\nCryptoPaste is a secure pastebin service inspired by [CryptoBin](https://cryptobin.org). Like CryptoBin, CryptoPaste strives to be a secure, stable and clean pastebin service, especially now that CryptoBin has seemingly shut its doors indefinitely. The goal is to perform all encryption, decryption, and data handling in the user's browser so that the CryptoPaste host has both plausible deniability and the inability to comply with court orders or takedown requests.\n\nCryptoPaste is a [HackThisSite](https://www.hackthissite.org) project.\n\n# Features\n- Pastes are encrypted in-browser before being sent to the server\n- No passwords stored\n- All identifying information is anonymized\n- Expired content is deleted forever\n- Web cron available\n- Template override supported\n\n# Demonstration\nAn active demonstration of CryptoPaste can be found at https://cryptopaste.org\n\n# Prerequisites\n- PHP \u003e= 7.0\n- Composer\n- MySQL / MariaDB\n\n# Install\n\n1. Clone or download this repository, then `cd` into the directory, and run\n\n`$ composer install`\n\nBecause CryptoPaste uses the Symfony framework, Composer will automatically prompt you for configuration settings. Unfortunately this does not include definitions in the prompts, so please read the comments in `app/config/parameters.yml.dist` for an explanation of what the configuration settings are.\n\nIf you want to change the configuration settings later (i.e. changing to a DB user will limited permissions), they are saved in the `app/config/parameters.yml` file.\n\n2. Install the database using the following command:\n\n`$ php bin/console doctrine:migrations:migrate`\n\nThis will install the database schema using the username and password you supplied in step 1. The database user you specified will need enough permissions to create the database and so forth. If you want to specify a different user to do this, edit the `app/config/parameters.yml` file.\n\n3. Edit your `nginx.conf` and make it look something like the following:\n\n\u003cpre\u003e\nhttp {\n\n  # These maps anonymize IP addresses in nginx logs\n\n  map $remote_addr $ip_anonym1 {\n   default 0.0.0;\n   \"~(?P\u0026lt;ip\u003e(\\d+)\\.(\\d+)\\.(\\d+))\\.\\d+\" $ip;\n   \"~(?P\u0026lt;ip\u003e[^:]+:[^:]+):\" $ip;\n  }\n\n  map $remote_addr $ip_anonym2 {\n   default .0;\n   \"~(?P\u0026lt;ip\u003e(\\d+)\\.(\\d+)\\.(\\d+))\\.\\d+\" .0;\n   \"~(?P\u0026lt;ip\u003e[^:]+:[^:]+):\" ::;\n  }\n\n  map $ip_anonym1$ip_anonym2 $ip_anonymized {\n   default 0.0.0.0;\n   \"~(?P\u0026lt;ip\u003e.*)\" $ip;\n  }\n\n  log_format anonymized '$ip_anonymized - $remote_user [$time_local] '\n     '\"$request\" $status $body_bytes_sent '\n     '\"$http_referer\" \"$http_user_agent\"';\n\n  access_log /var/log/nginx/access.log anonymized;\n}\n\nserver {\n  listen 80;\n  server_name _;\n  access_log /var/log/nginx/access.log anonymized;\n\n  root /path/to/cryptopaste/web;\n\n  index app.php;\n  location ~ /\\.ht {\n    deny  all;\n  }\n  location / {\n    try_files $uri /app.php$is_args$args;\n  }\n\n  location ~ ^/app\\.php(/|$) {\n    fastcgi_pass unix:/var/run/php-fpm.sock;\n    fastcgi_split_path_info ^(.+\\.php)(/.*)$;\n    include fastcgi_params;\n    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    fastcgi_param PATH_INFO $fastcgi_script_name;\n    fastcgi_param SERVER_NAME $host;\n  }\n}\n\u003c/pre\u003e\n\n4. If you chose not to enable the web cron, add an entry to your crontab to ensure deletion of expired pastes and sessions. Here is an example crontab entry that is run every hour as the `www-data` user:\n\n\u003cpre\u003e\n0\t*\t*\t*\t*\twww-data\t/usr/bin/php /path/to/cryptopaste/bin/console cron:run\n\u003c/pre\u003e\n\n# Upgrade\n\nBecause Silex is now end-of-life, CryptoPaste v1.0 is a complete recode in the Symfony 3.4 framework. This has resulted in some major changes, but your data should be portable from a v0.x version of CryptoPaste.\n\n## Warning about SQLite\n\nCryptoPaste v1.x no longer supports SQLite. If you were using SQLite, please convert it to a MySQL database, table name of `cryptopaste`, and follow the upgrade procedure below.\n\n## Upgrade from v0.1.x to v1.x\n\n1. Make sure to backup your database and your `config.ini` file! You will need the data from your `config.ini` in the next steps.\n\n2. Delete your old v0.x CryptoPaste installation, but do not delete your database!\n\n3. Follow **all** of the instructions for Installation above, including for cron jobs and nginx settings. When prompted for configuration settings during the `composer install` phase, use the values from your `config.ini`. You will need to provide MySQL credentials for a user that can create and alter tables.\n\n4. When you run the `bin/console doctrine:migrations:migrate` command from the Installation instructions, this will automatically convert your database for CryptoPaste v1.x.\n\n## Upgrade v1.x\n\n1. Make sure you backup your database and `app/config/parameters.yml` file!\n\n2. If you cloned this repository, `cd` into your CryptoPaste installation directory and run `git pull`. If not, you will need to clone or download this repository to a new directory, then move your old `app/config/parameters.yml` file and any custom templates into your that new directory.\n\n3. Next, run\n\n`$ composer install`\n\nBecause CryptoPaste uses the Symfony framework, Composer will automatically prompt you for any new configuration settings. Unfortunately this does not include definitions in the prompts, so please read the comments in `app/config/parameters.yml.dist` for an explanation of what the configuration settings are.\n\nIf you want to change the configuration settings later (i.e. changing to a DB user will limited permissions), they are saved in the `app/config/parameters.yml` file.\n\n4. Update the database using the following command:\n\n`$ php bin/console doctrine:migrations:migrate`\n\nThis will update the database schema using the username and password specified in your `app/config/parameters.yml` file. The database user you specified will need enough permissions to modify the database and so forth. If you want to specify a different user to do this, edit the `app/config/parameters.yml` file.\n\n5. Clear the CryptoPaste application cache by running the following command:\n\n`$ php bin/console cache:clear`\n\n# Modify the template\n\nNote that all template files are written in [Twig 2.0](https://twig.symfony.com). You can find the documentation for it [here](https://twig.symfony.com/doc/2.x/).\n\n## Override default template files\n\nAll default template files reside in `app/Resources/views/default/`. If you want to override any file here, simply copy the file to the `custom/` directory one level up and modify as needed. For example, if you want to override the FAQ page, you would copy `app/Resources/views/default/pages/faq.html.twig` to `app/Resources/views/custom/pages/faq.html.twig`.\n\n## Add custom static pages\n\nIf you want to add custom static pages, i.e. a privacy policy or terms of service, you can do that quite easily as described below.\n\n### Custom page file\n\nFirst, create a file in `app/Resources/views/custom/pages/` that must end in `.html.twig`. The part before `.html.twig` will become the page *slug*, or identifier, used in the URL and menu. For example, if you create `app/Resources/views/custom/pages/privacy.html.twig`, then \"privacy\" becomes the slug.\n\nTwo Twig settings must exist within a custom page:\n\n* **extends** - Must be set exactly as shown below in the example\n* **content** block - The HTML to display\n\nThere are also some optional settings:\n\n* **title** - Page title that shows up in the `\u003ctitle\u003e` HTML tag\n* **breadcrumb** - Breadcrumb that appears on the left side of the top menu bar. Hash-map of two values:\n  * **icon** - Fontawesome icon ([reference](https://fontawesome.com/icons))\n  * **text** - Text to show in the breadcrumb\n* **head** block - HTML content to put just before the `\u003c/head\u003e` closing tag\n* **footerjs** block - HTML content to put just before the `\u003c/body\u003e` closing tag\n\nShown below is an example of a privacy policy custom page.\n\n\u003cpre\u003e\n{% extends [\"custom/_template.html.twig\", \"default/_template.html.twig\"] %}\n{% set title = \"Privacy Policy\" %}\n{% set breadcrumb = {'icon': 'lock', 'text': 'Privacy Policy'} %}\n\n{% block content %}\n\n... privacy policy HTML ...\n\n{% endblock %}\n\u003c/pre\u003e\n\nAll page URL slugs are prefixed with `/p/`, such as `/p/privacy` for the above privacy policy page (if your CryptoPaste is accessible at `http://cryptopaste/` then this would be `http://cryptopaste/p/privacy`).\n\nIf your page filename starts with an underscore (`_`), then the page will not be visible and will return a 404 error.\n\n### Modify the menu\n\nIf you want your custom page or an outside URL to be visible in the top menu bar, you will need to create a `app/Resources/views/custom/_menu.yaml.twig` file. You can copy the default `app/Resources/views/default/_menu.yaml.twig` to start and modify as needed. You can also use this to hide the default FAQ page if you don't want to show it.\n\nThe `_menu.yaml.html` file contents must start with a `menu` key, and each menu item is a list of two keys. You must have the **name** key set, and either **slug** or **url**:\n* **name** - The name to show in the menu\n* **slug** - The slug of your custom page (the part of the filename just before the `.html.twig` extension)\n* **url** - A URL to point to\n\nShown below is an example of a custom menu with the default FAQ page, a privacy policy custom page, and a link to an outside website. Note that this list is ordered top-to-bottom == left-to-right. So the menu example below would render the menu as: 'HackThisSite | Privacy Policy | FAQ | New Paste' ('New Paste' is always shown).\n\n\u003cpre\u003e\nmenu:\n    -\n        name: 'HackThisSite'\n        url: 'https://www.hackthissite.org'\n    -\n        name: 'Privacy Policy'\n        slug: privacy\n    -\n        name: 'FAQ'\n        slug: faq\n\u003c/pre\u003e\n\nIf a menu slug starts with an underscore (`_`), that menu item will be hidden.\n\nIf you don't want to show anything in the menu except the 'New Paste' button, simply create an empty `_menu.yaml.twig` file in the `custom/` folder.\n\n# TODO\n- (**Need Help!**) Write legitimate testing\n- (**Need Help!**) Fix the UI to have better responsive scaling and other improvements\n\n# License\n\nCryptoPaste is licensed under the **GNU General Public License v3.0**. More details are in the [LICENSE](LICENSE) file.\n\n# Acknowledgements\n\nCryptoPaste uses the following technologies:\n* [Symfony framework](http://symfony.com)\n* [Composer](https://getcomposer.org), [phpUnit](https://phpunit.de)\n* Client-side JavaScript libraries and frameworks:\n  * [Bootstrap](http://getbootstrap.com) and [jQuery](https://jquery.com)\n  * AES encryption and password generation from the [Stanford Javascript Crypto Library](https://crypto.stanford.edu/sjcl/)\n  * AES backward compatability by [Moveable Type](http://www.movable-type.co.uk/scripts/aes.html)\n  * Syntax highlighting by [Highlight.js](https://highlightjs.org)\n  * Password strength testing by [zxcvbn](https://github.com/dropbox/zxcvbn)\n  * [smoothscroll polyfill](https://iamdustan.github.io/smoothscroll)\n  * [clipboard.js](https://zenorocha.github.io/clipboard.js)\n* [Travis-CI](https://travis-ci.org), [CLA Assistant](https://cla-assistant.io)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackthissite%2Fcryptopaste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackthissite%2Fcryptopaste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackthissite%2Fcryptopaste/lists"}