Skip to content

Instantly share code, notes, and snippets.

View tuxxy's full-sized avatar
🐧
Lettuce-based Cryptography is the future of cryptosalads

tux tuxxy

🐧
Lettuce-based Cryptography is the future of cryptosalads
View GitHub Profile
@tuxxy
tuxxy / mul.rs
Created July 21, 2020 13:32
Reduced Radix Schoolbook Multiplication modulo p
fn mul(self, rhs: &'b FieldElement5x52) -> FieldElement5x52 {
const LOW_52_BIT_MASK: u128 = (1 << 52) - 1;
const LOW_48_BIT_MASK: u128 = (1 << 48) - 1;
const R: u128 = 0x1000003D10; // R = 2^256 mod p
#[inline(always)]
fn m(x: u64, y: u64) -> u128 { (x as u128) * (y as u128) }
let a: &[u64; 5] = &self.0;
let b: &[u64; 5] = &rhs.0;
@tuxxy
tuxxy / springer-free-maths-books.md
Created September 20, 2018 18:31 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links

Keybase proof

I hereby claim:

  • I am tuxxy on github.
  • I am tux_ (https://keybase.io/tux_) on keybase.
  • I have a public key whose fingerprint is 2CF6 0381 B5EF 29B7 D48C 2020 7BB9 71A0 E891 44D9

To claim this, I am signing this object:

@tuxxy
tuxxy / homomorphic_rsa_demo.py
Last active October 31, 2019 03:16
This is a demo of the multiplicative homomorphic qualities of unpadded RSA encryption.
#!/usr/bin/env python3
from Cryptodome.PublicKey import RSA
# A proof of concept demo showing the multiplicative limited
# homomorphic qualities of unpadded RSA
# (Unpadded RSA is not secure by modern standards)
def gen_key(size):
key = RSA.generate(size)
### Keybase proof
I hereby claim:
* I am tuxxy on github.
* I am tux_ (https://keybase.io/tux_) on keybase.
* I have a public key whose fingerprint is 9679 BC01 329E E444 5022 64CB 859B C66E 72B0 F57A
To claim this, I am signing this object:
@tuxxy
tuxxy / pass.py
Last active May 8, 2019 18:32
Password Censor
#!/usr/bin/env python
import sys
""" Takes any file with format:
<hash>:<password>
as an argument. Example:
`python pass.py list.txt`
Include a second argument for output. Example:
`python pass.py list.txt output.txt`
Alternatively, you can use stdout: