Current collected state Current
Observed since 20 Oct, 18:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Ciphering made easy.
Ciphering made easy.
| Usage | Params | Return Value |
|---|---|---|
create_key() | None: None | int: key |
cipher() | str: message, int: key | str: ciphered |
decipher() | str: message, int: key | str: deciphered |
Lets say you have private JSON data that you need to encode:
# lets imagine this is the data
data = {
"username": "ilovecats",
"password": "meow123"
}
Of course though, writing this un-encoded data can be very unsafe. So the only way to protect it is to cipher it.
from json import dumps, loads
from os import getenv
data = {
"username": "ilovecats",
"password": "meow123"
}
# turn the JSON into a string we can encode
data = dumps(data)
# using a key we can store in our environment variables, we can cipher it
encoded_data = cipher(data, os.getenv("CIPHER_KEY")) # you can also keep the key in a variable, thought this is unsafe as users can just use the key
# voila! The data has been ciphered:
print(encoded_data)
And to decipher the data and use it, you can do the reverse:
from json import dumps, loads
from os import getenv
# decipher the data
decoded_data = decipher(encoded_data, os.getenv("CIPHER_KEY"))
# turn the string back into json data
data = loads(decoded_data)
# now you can use it!
print("Your username is" + data.username + "!")
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.7 | 5 Nov 2020 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:91ef9bcbf99cce85b69d9c7368c89f53ce328d4e216c87b4d66ba8059279f348