I have a function in my views.py where at some line I make a GET request of an id. Once I get the id, I want to encrypt that id and then later decrypt that also. So I need two functions
def encrypt(id):#let say the id is 100
#do something
return encrypted_id # 6-digit let say 985634
def decrypt(encrypted_id): # Here enter 985634
#do something
return decrypted_id # i should get 100
I have read many posts but not finding an easy and clean way to apply this in my views.py Here what I have studied
sha1 : You can't decrypt that (implemented for encryption) Mee 2 M2 . AES it deals with 16-digit that multiple of 8 something
I tried to generate 6-digit random number also but that idea is also not promising. Can anybody tell a way how to do this ? Thanks in advance