├── extension ├── .gitkeep ├── logo16.png ├── logo48.png ├── logo128.png ├── manifest.json ├── background.js └── SimpleDiscordCryptLoader.js ├── key.png ├── logo.png ├── blacklist.txt ├── images └── key128.png ├── SimpleDiscordCrypt.meta.js ├── SimpleDiscordCryptExtension.crx ├── PrivacyPolicy.md ├── SimpleDiscordCryptLoader.plugin.js ├── emojihash.html ├── LICENSE ├── SimpleDiscordCryptInstaller.ps1 └── README.md /extension/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/key.png -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/logo.png -------------------------------------------------------------------------------- /blacklist.txt: -------------------------------------------------------------------------------- 1 | 430057166368407584 owner request 2 | 703223547039842324 owner's request (nighthouse) 3 | -------------------------------------------------------------------------------- /images/key128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/images/key128.png -------------------------------------------------------------------------------- /extension/logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/extension/logo16.png -------------------------------------------------------------------------------- /extension/logo48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/extension/logo48.png -------------------------------------------------------------------------------- /extension/logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/extension/logo128.png -------------------------------------------------------------------------------- /SimpleDiscordCrypt.meta.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name SimpleDiscordCrypt 3 | // @version 1.7.5.0 4 | // ==/UserScript== 5 | -------------------------------------------------------------------------------- /SimpleDiscordCryptExtension.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/An00nymushun/End-to-end-Discord-Encryption/HEAD/SimpleDiscordCryptExtension.crx -------------------------------------------------------------------------------- /extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "SimpleDiscordCrypt", 4 | "version": "5", 5 | "description": "Discord message encryption plugin, it gives end-to-end clientside encryption for your messages and files with automatic key exchange", 6 | "icons": { 7 | "16": "logo16.png", 8 | "48": "logo48.png", 9 | "128": "logo128.png" 10 | }, 11 | "permissions": [ 12 | "storage", 13 | "webRequest", 14 | "webRequestBlocking", 15 | "https://gitlab.com/", 16 | "https://cdn.discordapp.com/", 17 | "https://discord.com/", 18 | "https://ptb.discord.com/", 19 | "https://canary.discord.com/" 20 | ], 21 | "background": { 22 | "scripts": ["background.js"], 23 | "persistent": true 24 | }, 25 | "content_scripts": [ { 26 | "js": ["SimpleDiscordCryptLoader.js"], 27 | "matches": [ 28 | "https://*.discord.com/channels/*", 29 | "https://*.discord.com/activity", 30 | "https://*.discord.com/login*", 31 | "https://*.discord.com/app", 32 | "https://*.discord.com/library", 33 | "https://*.discord.com/store", 34 | "https://*.discord.com/guild-discovery" 35 | ], 36 | "run_at": "document_start" 37 | } ] 38 | } 39 | -------------------------------------------------------------------------------- /extension/background.js: -------------------------------------------------------------------------------- 1 | const onHeadersReceived = (details) => { 2 | let header = details.responseHeaders.find(x => x.name.toLowerCase() === 'content-security-policy'); 3 | if(header != null) { 4 | header.value = ""; 5 | return { responseHeaders: details.responseHeaders }; 6 | } 7 | }; 8 | 9 | const filter = { 10 | urls: ["https://discord.com/*","https://ptb.discord.com/*","https://canary.discord.com/*"], 11 | types: ["main_frame"] 12 | }; 13 | 14 | chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, filter, ["blocking", "responseHeaders"]); 15 | 16 | chrome.runtime.onMessage.addListener((data, sender, sendResponse) => { 17 | if(data.type !== 'XMLHttpRequest') return; 18 | 19 | let request = data.request; 20 | 21 | let xhr = new XMLHttpRequest(); 22 | if(request.responseType) xhr.responseType = request.responseType; 23 | 24 | xhr.onload = () => { sendResponse((xhr.responseType === 'arraybuffer') ? { bloburl: URL.createObjectURL(new Blob([xhr.response])) } : { response: xhr.response }) }; 25 | xhr.onerror = () => { sendResponse(null) }; 26 | 27 | xhr.open(request.method || 'GET', request.url); 28 | xhr.withCredentials = true; 29 | xhr.send(); 30 | 31 | return true; 32 | }); -------------------------------------------------------------------------------- /extension/SimpleDiscordCryptLoader.js: -------------------------------------------------------------------------------- 1 | let script = document.createElement('script'); 2 | script.textContent = `window.localStorageBackup = window.localStorage; Object.freeze = o => o;`; 3 | (document.head||document.documentElement).appendChild(script); 4 | script.remove(); 5 | 6 | 7 | const makeRequest = (data, responseCallback) => { 8 | try { 9 | chrome.runtime.sendMessage(data, (result) => { 10 | if(result.bloburl !== undefined) { 11 | fetch(result.bloburl).then((response) => response.arrayBuffer()).then((response) => { 12 | responseCallback({ response }); 13 | URL.revokeObjectURL(result.bloburl); 14 | }); 15 | } 16 | else responseCallback(result); 17 | }); 18 | } catch { location.reload() } //extension unloaded/reloaded 19 | }; 20 | 21 | window.addEventListener('message', (event) => { 22 | if(event.source !== window && event.data.type !== 'XMLHttpRequest' || event.ports[0] == null) return; 23 | 24 | makeRequest(event.data, (result) => { event.ports[0].postMessage(result) }); 25 | }); 26 | 27 | chrome.runtime.sendMessage({ type: 'XMLHttpRequest', request: { url: "https://gitlab.com/An0/SimpleDiscordCrypt/raw/master/SimpleDiscordCrypt.user.js" } }, (result) => { //or chrome.runtime.getURL("SimpleDiscordCrypt.user.js") 28 | let script = document.createElement('script'); 29 | script.textContent = ` 30 | (()=>{ 31 | const GM_xmlhttpRequest = (requestObject) => { 32 | let onload = requestObject.onload; 33 | let onerror = requestObject.onerror; 34 | delete requestObject.onload; 35 | delete requestObject.onerror; 36 | let channel = new MessageChannel(); 37 | channel.port1.onmessage = (event) => { 38 | let response = event.data; 39 | if(response == null) { 40 | if(onerror) onerror(); 41 | } 42 | else onload(event.data); 43 | } 44 | window.postMessage({ type: 'XMLHttpRequest', request: requestObject }, "*", [channel.port2]); 45 | }; 46 | const localStorage = window.localStorageBackup; 47 | const CspDisarmed = true; 48 | ${result.response}})()`; 49 | (document.head||document.documentElement).appendChild(script); 50 | script.remove(); 51 | }); -------------------------------------------------------------------------------- /PrivacyPolicy.md: -------------------------------------------------------------------------------- 1 |

Privacy Policy

2 | 3 | 4 |

Effective date: May 30, 2019

5 | 6 | 7 |

SDC ("us", "we", or "our") operates the SimpleDiscordCrypt browser extension (the "Service").

8 | 9 | 10 |

Information Collection And Use

11 | 12 |

We do not collect information about you.

13 | 14 |

Types of Data Collected

15 | 16 |

Nothing.

17 | 18 |

While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you ("Personal Data").

19 | 20 |

Encryption keys which are not personal data and are generated by the Service and shared with other Service users.

21 | 22 | 23 |

Use of Data

24 | 25 |

SDC may use the collected data to provide customer care and support

Transfer Of Data 28 |

SDC will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country.

29 | 30 | 31 |

Security Of Data

32 |

The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security.

33 | 34 |

Service Providers

35 |

We may employ third party companies and individuals to facilitate our Service ("Service Providers"), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Service is used.

36 | 37 | 38 |

Links To Other Sites

39 |

Our Service may contain links to other sites that are not operated by us. If you click on a third party link, you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every site you visit.

40 |

We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.

41 | 42 | 43 |

Children's Privacy

44 |

Our Service does not address anyone under the age of 18 ("Children").

45 |

We do not knowingly collect personally identifiable information from anyone under the age of 18.

46 | 47 | 48 |

Changes To This Privacy Policy

49 |

We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.

50 |

You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.

51 | 52 | 53 |

Contact Us

54 |

If you have any questions about this Privacy Policy, please contact us: https://gitlab.com/An0/SimpleDiscordCrypt/issues

-------------------------------------------------------------------------------- /SimpleDiscordCryptLoader.plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name SimpleDiscordCryptLoader 3 | * @version 1.2 4 | * @description Loads SimpleDiscordCrypt 5 | * @author An0 6 | * @source https://gitlab.com/An0/SimpleDiscordCrypt 7 | */ 8 | 9 | /*@cc_on 10 | @if (@_jscript) 11 | var shell = WScript.CreateObject("WScript.Shell"); 12 | var fs = new ActiveXObject("Scripting.FileSystemObject"); 13 | var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins"); 14 | var pathSelf = WScript.ScriptFullName; 15 | shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30); 16 | if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) { 17 | shell.Popup("I'm in the correct folder already.", 0, "I'm already installed", 0x40); 18 | } else if (!fs.FolderExists(pathPlugins)) { 19 | shell.Popup("I can't find the BetterDiscord plugins folder.\\nAre you sure it's even installed?", 0, "Can't install myself", 0x10); 20 | } else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) { 21 | fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true); 22 | // Show the user where to put plugins in the future 23 | shell.Exec("explorer " + pathPlugins); 24 | shell.Popup("I'm installed!", 0, "Successfully installed", 0x40); 25 | } 26 | WScript.Quit(); 27 | @else @*/ 28 | 29 | 30 | var SimpleDiscordCryptLoader = (() => { 31 | 32 | 'use strict'; 33 | 34 | let localStorage; 35 | let iframe; 36 | const CspDisarmed = true; 37 | let Initialized = false; 38 | let Loaded = false; 39 | 40 | var InitPromise; 41 | 42 | function Start() { 43 | if(!Initialized) { 44 | iframe = document.createElement('iframe'); 45 | iframe.style.display = 'none'; 46 | 47 | iframe.onload = () => { 48 | iframe.contentDocument.body.innerHTML = "