🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

sayaka

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sayaka

A Rust-backed Python module for decrypting and decompressing data for an anime game.

0.4.3
PyPI
Maintainers
1

Sayaka

Sayaka is a Rust-backed Python module for decrypting and decompressing data for an anime game. It leverages PyO3 to provide a high-performance decompression function directly from Python.

Installation

Prerequisites

  • Rust (edition 2024)
  • Python (version 3.12 or higher)
  • maturin for building the extension module

Build and Install

  • Clone the repository:

    git clone https://github.com/baiqwerdvd/sayaka.git
    cd sayaka
    
  • Build the module using maturin:

    uv sync
    uv run maturin develop --release
    

Usage

Import the module in your Python code to decrypt or decompress data. The module provides three main functions:

  • decompress_buffer: Decompresses data using LZ4 compression.
  • miki_decrypt: Decrypts data encrypted with the Miki algorithm.
  • miki_decrypt_old: Decrypts data encrypted with the old Miki algorithm.
  • miki_decrypt_and_decompress: Combines decryption and decompression in one step.
  • miki_decrypt_and_decompress_old: Combines decryption and decompression for the old Miki algorithm.

The function accepts any object implementing Buffer protocol (for example bytes, bytearray, memoryview) as input for the data.

import sayaka

with open("compressed_data.bin", "rb") as f:
    compressed_data = f.read()

decompressed_size = 9796
decompressed_data = sayaka.decompress_buffer(compressed_data, decompressed_size)
import sayaka

with open("miki_encrypted.bin", "rb") as f:
    encrypted_data = f.read()

decrypted_data = sayaka.miki_decrypt(encrypted_data)
import sayaka

with open("miki_old_encrypted.bin", "rb") as f:
    encrypted_data = f.read()

decrypted_data = sayaka.miki_decrypt_old(encrypted_data)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • PyO3 for making Python/Rust interop simple.
  • The LZ4 compression library for inspiration.
  • Lz4Inv for providing a reference implementation.
  • YarikStudio for decryption logic.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts