pip install git+https://github.com/giosg/giosg_crypter.git#egg=giosg-crypter==<version number>
Where <version number>
is the release version that user wants to install.
Provide paths to the files that contain chat_session and messages in file format.
Flag the messages with -m
or --messages
.
decrypt path/to/private/key/file path/to/chatsession/json/file -m path/to/messages/json/file
By providing a url that starts with https
, the chat session and the messages can be fetched online.
The API Token needs to be given with -t
or --token
flag.
In this case, url to the messages is not required.
decrypt path/to/private/key/file https://service.giosg.com/api/v5/path/to/chats/<chat_session_id> -t 6agf3a2b2f4440b6dfssb79ddb24ff2a5abbc9a2
Example of reading chat messages directly from API and printing to STDOUT:
decrypt path/to/private/key/file -t 6agf3a2b2f4440b6dfssb79ddb24ff2a5abbc9a2 https://service.giosg.com/api/v5/users/9ff0de38-93bd-11e7-9200-60f81db14236/chats/c7ee1fda-1cd8-11ea-873f-f218983fece9/ -o stdout
By default, output is written in a file with default name decrypted_messages.json
.
The filename can be changed using -f
or --filename
flag:
decrypt path/to/private/key/file path/to/chatsession/json/file pat/to/messages/json/file -f new_filename.json
The output can also be changed to stdout with -o
or --output
flag:
decrypt path/to/private/key/file path/to/chatsession/json/file pat/to/messages/json/file -o stdout
decrypt --version
or decrypt -v
decrypt --help
or decrypt -h
from giosg.crypter import AESKey, asymmetric_decrypt, symmetric_decrypt
aes_key = asymmetric_decrypt(private_key, encrypted_key_from_chat_session)
key = AESKey.from_json(aes_key)
symmetric_decrypt(key, message_field_to_be_decrypted])