Salmon
Loading...
Searching...
No Matches
salmon_core.salmon.salmon_decryptor Namespace Reference

Classes

class  SalmonDecryptor
 

Functions

(int, int) decrypt_data (RandomAccessStream input_stream, int start, int count, bytearray out_data, bytearray key, bytearray nonce, bytearray|None header_data, bool integrity, bytearray|None hash_key, int|None chunk_size, int buffer_size, str|None shm_cancel_name=None)
 
 decrypt_shm (int index, int part_size, int running_threads, bytearray data, str shm_out_name, int shm_length, str shm_cancel_name, bytearray key, bytearray nonce, bytearray|None header_data, bool integrity, bytearray|None hash_key, int|None chunk_size, int buffer_size)
 

Detailed Description

MIT License

Copyright (c) 2021 Max Kas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Function Documentation

◆ decrypt_data()

(int, int) decrypt_data ( RandomAccessStream input_stream,
int start,
int count,
bytearray out_data,
bytearray key,
bytearray nonce,
bytearray | None header_data,
bool integrity,
bytearray | None hash_key,
int | None chunk_size,
int buffer_size,
str | None shm_cancel_name = None )
Decrypt the data stream. Do not use directly use decrypt() instead.
:param input_stream: The Stream to be decrypted.
:param start: The start position of the stream to be decrypted.
:param count: The number of bytes to be decrypted.
:param out_data: The buffer with the decrypted data.
:param key: The AES key to be used.
:param nonce: The nonce to be used.
:param header_data: The header data to be used.
:param integrity: True to verify integrity.
:param hash_key: The hash key to be used for integrity verification.
:param chunk_size: The chunk size.
:param buffer_size: The buffer size.
:param shm_cancel_name: The shared memory cancelation name
:raises IOError: Thrown if there is an error with the stream.
:raises SalmonSecurityException: Thrown if there is a security exception with the stream.
:raises IntegrityException: Thrown if the stream is corrupt or tampered with.

◆ decrypt_shm()

decrypt_shm ( int index,
int part_size,
int running_threads,
bytearray data,
str shm_out_name,
int shm_length,
str shm_cancel_name,
bytearray key,
bytearray nonce,
bytearray | None header_data,
bool integrity,
bytearray | None hash_key,
int | None chunk_size,
int buffer_size )
Do not use directly use decrypt() instead.
:param index: The worker index
:param part_size: The part size
:param running_threads: The threads
:param data: The data to decrypt
:param shm_out_name: The shared memory name
:param shm_length: The shared memory length
:param shm_cancel_name: The shared memory for cancelation
:param key: The encryption key
:param nonce: The nonce
:param header_data: The header data
:param integrity: True to verify integrity
:param hash_key: The hash key
:param chunk_size: The chunk size
:param buffer_size: The buffer size