Clears the contents of bytes or integers containing cryptographic material
Project description
[![Build Status](https://travis-ci.com/VidaID/pysecbytes.svg?branch=master)](https://travis-ci.com/VidaID/pysecbytes)
## Install:
pip install SecureBytes
## Use:
Currently supports clearing integers, strings and bytes
from SecureBytes import clearmem, safemem
x = b’data that must be removed’
copy_of_x = x
clearmem(x)
assert(b’data’ not in copy_of_x)
In python3 only, temporarily overriding mem allocator to zero ram and prevent paging:
- with safemem():
x = b’data that must be removed’ del x
# x is not in ram
Currently, safemem and scanmem aren’t supported on all pythons and platforms, use import safemem_supported, scanmem_supported to check.
## Warnings:
Do not try to derive from str or bytes… extra copies of your data will be made
Clearing strings and bytes also clears all references to them
If you choose store sensitive material in a class, and put clearmem in __del__, it will only be cleared when the last reference is freed
“safemem” is not yet efficient (TODO), and it only prevents swapping on Windows (TODO)
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
File details
Details for the file SecureBytes-0.3.5.tar.gz
.
File metadata
- Download URL: SecureBytes-0.3.5.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24241525ce3bd3cf259fdc41c55786f13aa8fb20cfce25455d2618851d6d3852 |
|
MD5 | 25a62ce7e03552c8f3392862c8d05390 |
|
BLAKE2b-256 | 66da0c50a4d4decd15bc5e0816670128601c1ae78f6de945f0ffb36e74eadd00 |