Skip to content

Instantly share code, notes, and snippets.

View Goblin80's full-sized avatar
🐿️

Mahmoud Goblin80

🐿️
View GitHub Profile
@Goblin80
Goblin80 / BruteDES.java
Last active March 13, 2019 11:38
Crack DES (ECB) through searching whole key space using Java Streams
import javax.crypto.*;
import javax.crypto.spec.DESKeySpec;
import java.util.Arrays;
import java.util.stream.LongStream;
public class BruteDES {
public static byte[] encrypt(byte[] plaintext, byte[] rawkey) {
try {
return _digest(plaintext, rawkey, Cipher.ENCRYPT_MODE);
@Goblin80
Goblin80 / TripleDES.java
Created March 13, 2019 11:36
3DES (ECB) implementation in Java
import javax.crypto.*;
import javax.crypto.spec.DESKeySpec;
import java.util.Arrays;
public class TripleDES {
enum MODE {
ENCRYPT(0), DECRYPT(1);
int code;
@Goblin80
Goblin80 / rsa.py
Created April 11, 2019 19:28
implementation of RSA public-key cryptosystem in python
import argparse
class RSA:
def __init__(self, p, q, e):
self.p, self.q, self.e = p, q, e
self.n = p * q
self.phi = (p - 1) * (q - 1)
self.d = e ** (self.phi - 1) % self.phi
@Goblin80
Goblin80 / rmOtherEngines.js
Created May 1, 2020 16:48
Remove Chrome's Custom Search Engines
// Go to chrome://settings/searchEngines
// Open the Developer Tools
// Run the following in the Javascript console tab
const otherEngines = document.querySelector("body > settings-ui")
.shadowRoot.querySelector("#main")
.shadowRoot.querySelector("settings-basic-page")
.shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-search-page")
.shadowRoot.querySelector("#pages > settings-subpage > settings-search-engines-page")
.shadowRoot.querySelector("#otherEngines").shadowRoot