Exemple #1
0
def b64ToString(s):
    origin = s
    s = tools.change2Bytes(s)
    decode = base64.b64decode(s)
    decode = tools.change2Str(decode)
    info1 = '\nBase64:' + origin
    info2 = 'Base64 decode:' + decode
    printc.printf(info1, 'blue')
    printc.printf(info2, 'green')
Exemple #2
0
def b16ToString(s):
    origin = tools.change2Str(s)
    s = tools.change2Bytes(s)
    decode = base64.b16decode(s)
    encode = tools.change2Str(s)
    info1 = '\nBase16:' + s
    info2 = 'Base16 decode:' + decode
    printc.printf(info1, 'blue')
    printc.printf(info2, 'green')
Exemple #3
0
def stringToB16(s):
    origin = tools.change2Str(s)
    s = tools.change2Bytes(s)
    encode = base64.b16encode(s)
    encode = tools.change2Str(encode)
    info1 = '\nOriginal:' + origin
    info2 = 'Base16 encode:' + encode
    printc.printf(info1, 'blue')
    printc.printf(info2, 'green')
Exemple #4
0
def stringToB64(s):
    space = chr(0)
    origin = tools.change2Str(s)
    res = ""
    for i in s:
        res = res + str(i) + space
    s = res
    s = tools.change2Bytes(s)
    res = base64.b64encode(s)
    res = tools.change2Str(res)
    info1 = '\nOriginal:' + origin
    info2 = 'Base64 encode:' + res
    printc.printf(info1, 'green')
    printc.printf(info2, 'green')