当前位置:网站首页>Interface automatic encryption and decryption

Interface automatic encryption and decryption

2022-06-21 17:02:00 Expert of explosive liver fist

One 、 What is interface encryption and decryption

Interface encryption : In the interface test, in order to prevent data leakage or theft, the transmitted data is encrypted and then transmitted .

Interface decryption : In the interface test, the encrypted data is restored to the original data .

Encryption and decryption website : Encryption and decryption website

Two 、 Classification of interface encryption and decryption

1. Symmetric encryption : Use the same key for encryption and decryption , Such as :DES、AES、BASE64

2. Asymmetric encryption : Two keys are required for encryption ( Public key 、 Private key ) Mutual encryption and decryption , The public key is public , There is no need to keep it secret ; The private key is held by an individual or enterprise , It must be kept in good condition . Such as :
RSA encryption algorithm : 1) Public key encryption , Private key decryption
2) Private key encryption is called digital signature , Public key decryption is called verification signature

Online bank transfer : digital signature

3. Do not consider decryption at all
Such as :1)SHA1、SHA3…
2)MD5 encryption ( The hash algorithm , Hash algorithm )

3、 ... and 、 utilize Python Code encryption


url='http://127.0.0.1:5000/get_token'
# For the user name admin Conduct MD5 Encryption means encryption 
username=hashlib.md5('admin'.encode('utf-8')).hexdigest()

# Yes, the password 123 Conduct MD5 Encryption means encryption 
password=hashlib.md5('123'.encode('utf-8')).hexdigest()

data={
    
	# Capitalize the encrypted user name and password 
	'username': str(username).upper()
	'password': str(password).upper()
}
res=request.post(url,data=data)
print(res.json())

notes :data Parameter transfer :
Content-Type:application/x-www-form-urlencoded
json Parameter transfer :
Content-Type:application/json

requests.post On request , Whether the request is successful or not , Not determined by the front end , It's up to the back end .

原网站

版权声明
本文为[Expert of explosive liver fist]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211318464659.html