MCPcopy Create free account
hub / github.com/f0ng/autoDecoder / des_encrypt

Function des_encrypt

flasktest.py:8–18  ·  view source on GitHub ↗

DES 加密 :param s: 原始字符串 :return: 加密后字符串,16进制

(s)

Source from the content-addressed store, hash-verified

6import base64
7
8def des_encrypt(s):
9 """
10 DES 加密
11 :param s: 原始字符串
12 :return: 加密后字符串,16进制
13 """
14 secret_key = "f0ngtest"
15 iv = "f0ngf0ng"
16 k = des(secret_key, CBC, iv, pad=None, padmode=PAD_PKCS5)
17 en = k.encrypt(s, padmode=PAD_PKCS5)
18 return base64.encodebytes(en).decode()
19
20def des_decrypt(s):
21 """

Callers 1

encryptFunction · 0.85

Calls 2

decodeMethod · 0.80
encryptMethod · 0.45

Tested by

no test coverage detected