Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
pip install silk-python
import pysilk
with open("verybiginput.pcm", "rb") as pcm, open("output.silk", "wb") as silk:
pysilk.encode(pcm, silk, 24000, 24000)
import pysilk
with open("verybiginput.silk", "rb") as silk, open("output.pcm", "wb") as pcm:
pysilk.decode(silk, pcm, 24000)
file-like object
,比如BytesIO
,可以流式解码大文件Cython
, 关键部位 内联C函数,高性能from typing import BinaryIO
def encode(input: BinaryIO, output: BinaryIO, sample_rate: int, bit_rate: int, max_internal_sample_rate: int = 24000, packet_loss_percentage: int = 0, complexity: int = 2, use_inband_fec: bool = False, use_dtx: bool = False, tencent: bool = True) -> None: ...
def decode(input: BinaryIO, output: BinaryIO, sample_rate: int, frame_size: int = 0, frames_per_packet: int = 1, more_internal_decoder_frames: bool = False, in_band_fec_offset: int = 0, loss: bool = False) -> None: ...
class SilkError(Exception):
pass
合并了CFFI 的工作
python -m pip install setuptools wheel cython cffi
git clone https://github.com/synodriver/pysilk
cd pysilk
git submodule update --init --recursive
python setup.py bdist_wheel --use-cython --use-cffi
默认由py实现决定,在cpython上自动选择cython后端,在pypy上自动选择cffi后端,使用SILK_USE_CFFI
环境变量可以强制选择cffi
FAQs
silk encode and decode
We found that silk-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.