Skip to main content

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.

Changelog

08-01-2025: updated for latest versions of Polars and rust

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_encryption-0.1.5.tar.gz (37.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

polars_encryption-0.1.5-cp38-abi3-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (5.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

polars_encryption-0.1.5-cp38-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

polars_encryption-0.1.5-cp38-abi3-macosx_10_12_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file polars_encryption-0.1.5.tar.gz.

File metadata

  • Download URL: polars_encryption-0.1.5.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for polars_encryption-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e636137a4b0d95d53849b8dfd4a072a9569f2bf4ebf70020867430d7fb998189
MD5 80bbed133aca54e96d6800a71306b4d8
BLAKE2b-256 a506543ca4c84e8bca8a75d0010852293bc7e5dbd8e7ebdce5678bb6c19a412c

See more details on using hashes here.

File details

Details for the file polars_encryption-0.1.5-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_encryption-0.1.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bdd3c1753565c67275ece2329802eee97bf454e049f35261011fdbbe2e0f5763
MD5 9d469e88971d00614630799c7f504c91
BLAKE2b-256 bbcaa1d88a3f34d4a00e51d1aa05444c2ff0c73846e4004157a60e35250d5c3d

See more details on using hashes here.

File details

Details for the file polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 839f38c458148a73eca2ea3a3af027e63c6d1a80af96409ba169ed4c91985afe
MD5 ea9ac9e0bdbf0956fe7e0aaf8439af10
BLAKE2b-256 ec0e1e8112dbd964f8e319e76d3692c9780a0eab2a8150bdc090a217de173310

See more details on using hashes here.

File details

Details for the file polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for polars_encryption-0.1.5-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e6e957c65b7b11668c13ef33fcc784615f9e0a44b1d20a370753c0aaafe6aba2
MD5 43155cba932617f09d4dd1d77c5481ec
BLAKE2b-256 c7fbff275bdf8611fa153335eedd549b774ba7c41476a80b4a157715bc28d5f7

See more details on using hashes here.

File details

Details for the file polars_encryption-0.1.5-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_encryption-0.1.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23ab6b2bce97fc0631d8769593356a262eee908e73b2a70af0e1d12dacc4afc9
MD5 133d0f6f44ebfae36b3308b51b99454e
BLAKE2b-256 1a08a99cab395119d68d1e4edc3b6d6650924ab7e57870e5a0e6013b9ecc2c92

See more details on using hashes here.

File details

Details for the file polars_encryption-0.1.5-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_encryption-0.1.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 431f52f723412fbae4b6f7e91894a510594f2a86b0e9f858f56f3016b11f1348
MD5 b56aed3bcabebc1e98ec2285fac23f63
BLAKE2b-256 d3982c2c8242bf4499f442649d52008bab8604ad02a779f6d95dd9b2390d620f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page