@ebest/

Secure Storage

Python

No description

fork
loading
Files
  • main.py
  • requirements.txt

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.22833856677366526","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IGpzb25fc3RvcmVfY2xpZW50CmZyb20gQ3J5cHRvLkNpcGhlciBpbXBvcnQgQUVTCmZyb20gaGFzaGxpYiBpbXBvcnQgc2hhNTEyCgpjbGllbnQgPSBqc29uX3N0b3JlX2NsaWVudC5DbGllbnQoCiAgICAnMmE5MjMyMGY1N2Y2YmZmZmFiZDkxZmVhOWY3Yjc4OGQyOTBlNmQxY2QyNzRjZTZjMTYyMzdhYTNkZjFjNGJkOCcpCnNyID0gaW5wdXQoIlN0b3JlIG9yIFJldHJpdmU/IChzIG9yIHIpICIpCmlmIHNyID09ICJzIjoKCW1lc3NhZ2UgPSBpbnB1dCgiTWVzc2FnZSB0byBzdG9yZT8gIikKCWtleSA9IGlucHV0KCJLZXk/IChtdXN0IGJlIDE2IGNoYXJhY3RvcnMgbG9uZykgKHR5cGUgZCBmb3IgZGVmYWx0KSIpCglpZiBrZXkgPT0gImQiOgoJCWVvYmogPSBBRVMubmV3KCIhYUk5KjdNY1Uqb3BkQ0k4IiwgQUVTLk1PREVfQ0ZCLCAnUG9kVWQ0RDQ5JiMoUG9tNCcpCgllbHNlOgoJCWVvYmogPSBBRVMubmV3KGtleSwgQUVTLk1PREVfQ0ZCLCAnUG9kVWQ0RDQ5JiMoUG9tNCcpCgljaXBoZXJ0ZXh0ID0gZW9iai5lbmNyeXB0KG1lc3NhZ2UpCglwYXNzd29yZCA9IGlucHV0KCJQYXNzd29yZD8gIikKCXNhbHQgPSAiM2Q5ODdmYmMzYzgxNDZjMWE0OTAzZTVkMTk4NTEyYzkiCgloYXNoZWRfcGFzc3dvcmQgPSBzaGE1MTIocGFzc3dvcmQuZW5jb2RlKCkgKyBzYWx0LmVuY29kZSgpKS5oZXhkaWdlc3QoKQoJ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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import json_store_client
from Crypto.Cipher import AES
from hashlib import sha512

client = json_store_client.Client(
    '2a92320f57f6bfffabd91fea9f7b788d290e6d1cd274ce6c16237aa3df1c4bd8')
sr = input("Store or Retrive? (s or r) ")
if sr == "s":
	message = input("Message to store? ")
	key = input("Key? (must be 16 charactors long) (type d for defalt)")
	if key == "d":
		eobj = AES.new("!aI9*7McU*opdCI8", AES.MODE_CFB, 'PodUd4D49&#(Pom4')
	else:
		eobj = AES.new(key, AES.MODE_CFB, 'PodUd4D49&#(Pom4')
	ciphertext = eobj.encrypt(message)
	password = input("Password? ")
	salt = "3d987fbc3c8146c1a4903e5d198512c9"
	hashed_password = sha512(password.encode() + salt.encode()).hexdigest()
	stuffs = client.retrieve("Msg platform")
	print(hashed_password)
	stuffs[hashed_password] = ciphertext
	client.store("Msg platform", stuffs)
if sr == "r":
	key = input("Key? (d for defalt) ")
	if key == "d":
		dobj = AES.new("!aI9*7McU*opdCI8", AES.MODE_CFB, 'PodUd4D49&#(Pom4')
	else:
		dobj = AES.new(key, AES.MODE_CFB, 'PodUd4D49&#(Pom4')
	stuff = client.retrieve("Msg platform")
	password = input("Password? ")
	salt = "3d987fbc3c8146c1a4903e5d198512c9"
	hashed_password = sha512(password.encode() + salt.encode()).hexdigest()
	message = stuff.get(hashed_password)
	if message == None:
		print("Nothing here!")
	else:
		fmessage = dobj.decrypt(message)
		print(fmessage.decode())
if sr == "reset":
	client.store("Msg platform", {})