No project description provided
Project description
Polars Encryption
This is a plugin to extend Polars with encryption algorithm AES-GSM-SIV written in Rust for a blazing fast (c) performance.
Sources
This plugin is built using a guide by Marco Gorelli.
The encryption algorithm crate is this. The specific implementation is a 256bit version of it.
Usage
There are two methods: encrypt and decrypt. Both require key and nonce, as per algorithm specification.
import polars as pl
from polars_encryption import encrypt, decrypt
# Define the DataFrame
df = pl.DataFrame({
"plaintext": ["Hello, world!", "Polars is fast!", "Encrypt me!"]
})
# Define the encryption key and nonce
key = b"an example very very secret key."
nonce = b"unique nonce" # 12 bytes (96 bits)
# Encrypt the plaintext column
df_encrypted = df.with_columns(
encrypt(pl.col("plaintext"), key=key, nonce=nonce).alias("ciphertext")).with_columns(decrypt(pl.col("ciphertext"), key=key, nonce=nonce).alias("decrypted"))
print((df["plaintext"] == df_encrypted["decrypted"]).all())
print(df_encrypted)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file polars_encryption-0.1.0.tar.gz
.
File metadata
- Download URL: polars_encryption-0.1.0.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 711b21a46ffa67e209e12d2617ad34ef1df1112b288586e91f7c70ef00c0b3eb |
|
MD5 | b8252f6aae8d3dc2a9c7da17dae2fcfd |
|
BLAKE2b-256 | 9ac6b03aebdd02609c71f06b948c2b556b80608fc603c1b32e2205961f27cf35 |
File details
Details for the file polars_encryption-0.1.0-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: polars_encryption-0.1.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8071f8687c3178c2fa0679b104d29ad720a55fcae604e586b512b4949419bcb |
|
MD5 | 3c8e3caf21c96cc370d618b393699123 |
|
BLAKE2b-256 | 6b72f12897619f64e9bbafc9955a38dcee0da2faec8786c8a2e2fb6ff4c84aef |
File details
Details for the file polars_encryption-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: polars_encryption-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d025a2c66b2c8460a2b38d454bb944bae618d72a367be7fbf8454deb1e994591 |
|
MD5 | 94224ee266c418eeb545d9394a75b8c9 |
|
BLAKE2b-256 | 173df10bbb699f47556480fc14675a0b2195b761e572c420f0a074c9c62c49d3 |
File details
Details for the file polars_encryption-0.1.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: polars_encryption-0.1.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7f5eed83e75d7f9f1238dd2dacc07ad20ddf636c806154a4b7cd58cf0483b6 |
|
MD5 | 36680957143dd3d717a2d1d52ec66144 |
|
BLAKE2b-256 | f7bc4eb4ce1088d236f208c57633128a6b83b679f97669909eb66af305b932b9 |
File details
Details for the file polars_encryption-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: polars_encryption-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff234c60b2c73c9265959a8e94a4f703dc0b3743f9a28856cabb27d76f0378c5 |
|
MD5 | f017723aaafa269a119e209637a60601 |
|
BLAKE2b-256 | fd4c5035bfd337ad1b005d0a8239e4eaa6fb1b1dd41c41fc4d1d024279fd60fa |
File details
Details for the file polars_encryption-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: polars_encryption-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaccc4e7612797f272c0469aaeca31a17df559ea71285fcd63c90ada256bda76 |
|
MD5 | 63ef8f0bcc149ddb4ea3e1046c392223 |
|
BLAKE2b-256 | 52c9806716b9ce6e0a0c3b90543a2e2c6d5cf68c4488280b7febdcef08a0771b |