Skip to content

Commit

Permalink
Create crypto.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 10, 2024
1 parent 91e72f7 commit b782c68
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import hashlib

def encrypt(data, key):
encrypted_data = hashlib.sha256(data.encode()).hexdigest()
return encrypted_data

def decrypt(encrypted_data, key):
decrypted_data = hashlib.sha256(encrypted_data.encode()).hexdigest()
return decrypted_data

0 comments on commit b782c68

Please sign in to comment.