Example #1
0
#!/usr/bin/env python3

import prn
import rnd

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(32)
prn.print_bytes(a, 24)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(1343)
prn.print_bytes(a, 16)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(332)
prn.print_bytes(a, 8)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(1011)
prn.print_bytes(a, 1)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(100)
prn.print_bytes(a, 2)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(100)
prn.print_bytes(a, 25)

# ---------------------------------------------------------------------------- #
a = rnd.get_rnd(1023)
Example #2
0
#!/usr/bin/env python3

import ncp
import prn
import sys

# ---------------------------------------------------------------------------- #
src = ''
st = 0
le = 0
sh = 0

try:
    src = sys.argv[1]
    src = src.encode('utf-8')
    st = int(sys.argv[2])
    le = int(sys.argv[3])
    sh = int(sys.argv[4])
except:
    print('usage: <str> <start> <len> <shift>')
    exit()

# ---------------------------------------------------------------------------- #
prn.print_bytes(src, 16)
ncp.shift(src, st, le, sh)
prn.print_bytes(src, 16)
Example #3
0
#!/usr/bin/env python3
# test crypt.so

import sys
import ncp
import prn

# ---------------------------------------------------------------------------- #
# parse arguments
src = ''
size = 0

try:
    src = sys.argv[1]
    size = int(sys.argv[2])
except:
    print('Usage: <string> <size>')
    exit()

print('src  = ', src)
print('size = ', size)
src = src.encode('utf-8')

# ---------------------------------------------------------------------------- #
# hash_r
h = ncp.hash_r(src, size)
prn.print_bytes(h, 16)