Skip to content

Instantly share code, notes, and snippets.

@finwo
Last active August 29, 2017 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save finwo/ebfd96e35eeffc19dc25f5afc11b9c98 to your computer and use it in GitHub Desktop.
Save finwo/ebfd96e35eeffc19dc25f5afc11b9c98 to your computer and use it in GitHub Desktop.

Cryptography ideas

Mainly based upon the verification step in IBAN, a.k.a. multi-step modulus

Simplest form

*256 mod key

KEY : 22709
MUL : 256
DATA: 0xDEADBEEF

Valid
ABCD: ABCDD908DC92
9BCD: 9BCD5382758B

Incompatible
BBCD: BBCD5F6F-

Added randomness

7 bits data per 8 bits encoded stream

*256 mod key

KEY: 991
MUL: 256
DATA: 0b11011110 // 0x DEADBEEF
      0b10101101
      0b10111110
      0b11101111
      
      1101111 0101011 0110111 1101110 1111
      
      6F
      2B
      37
      6E
      0F

3E: 3E5F8F469C6F
3D: 3D80E84A1EF1

3E5F8F469C6F
3E5F         =  6F = 6F
  6F8F       = 32B = 2B
   32B46     = 237 = 37
     2379C   = 26E = 6E
       26E6F = 30F = 0F

3D80E84A1EF1
3D80         = 36F = 6F
 36FE8       = 12B = 2B
   12B4A     = 137 = 37
     1371E   = 16E = 6E
       16EF1 = 30F = 0F

More complexity

Functional example

KEY: (m) >=128
MUL: (t) >=1

DATA: 0b11011110 // 0x DEADBEEF
      0b10101101
      0b10111110
      0b11101111
      
      1101111 0101011 0110111 1101110 1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment