Skip to content

Commit 0f3cd09

Browse files
committed
examples, docs, version
1 parent 8d85d37 commit 0f3cd09

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zeroize"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ It uses [zeroize](https://crates.io/crates/zeroize) crate under the hood.
1111
It can work with `bytearray` and `numpy array`.
1212

1313
> [!WARNING]
14-
> **In the case of [Copy-on-write fork](https://en.wikipedia.org/wiki/Copy-on-write) you should zeroize the memory before fork the child process, see example below.
15-
> Also by itself it doesn't work if memory is moved or moved to swap file. You can use `crypes` with `libc.mlock()` to lock the memory, see example below.**
14+
> **In the case of [Copy-on-write fork](https://en.wikipedia.org/wiki/Copy-on-write) you need to zeroize the memory before forking the child process, see example below.
15+
> Also by itself it doesn't work if memory is moved or moved to swap. You can use `crypes` with `libc.mlock()` to lock the memory, see example below.**
1616
1717
# Examples
1818

examples/lock_and_zeroize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""By itself it doesn't work if memory is moved or moved to swap. You can use `crypes` with `libc.mlock()` to lock the memory"""
2+
13
from zeroize import zeroize1, zeroize_np
24
import numpy as np
35
import ctypes

examples/zeroize_before_fork.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
""" In the case of [Copy-on-write fork](https://en.wikipedia.org/wiki/Copy-on-write) you need to zeroize the memory before forking the child process. """
2+
13
import os
2-
from zeroize import zeroize1, zeroize_np
3-
import numpy as np
4+
from zeroize import zeroize1
45
import ctypes
56

67

@@ -51,4 +52,3 @@ def unlock_memory(buffer):
5152
# Unlock the memory
5253
print("unlocking memory")
5354
unlock_memory(sensitive_data)
54-

0 commit comments

Comments
 (0)