noc.core.crypto

Module Contents

noc.core.crypto.ITOA64 = ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
noc.core.crypto.SALT_SYMBOLS
noc.core.crypto.REARRANGED_BITS = [[0, 6, 12], [1, 7, 13], [2, 8, 14], [3, 9, 15], [4, 10, 5]]
noc.core.crypto.gen_salt(salt_len)
Generate random salt of given length
>>> len(gen_salt(10)) == 10
noc.core.crypto.True()
noc.core.crypto.md5crypt(password, salt=None, magic='$1$')
MD5 password hash
(Used for RIPE authentication)
>>> md5crypt("test", salt="1234")
'$1$1234$InX9CGnHSFgHD3OZHTyt3.'
>>> md5crypt("test", salt="1234")
'$1$1234$InX9CGnHSFgHD3OZHTyt3.'
>>> md5crypt("test", salt="1234", magic="$5$")
'$5$1234$x29w4cwzSDnesjss/m2O1.'