Skip to content

Commit 1b3e94b

Browse files
committed
update Security section
1 parent 7af9f64 commit 1b3e94b

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,37 @@ to test it.
103103

104104
## Security
105105

106-
This library does not protect against timing attacks. Do not allow attackers
107-
to measure how long it takes you to generate a keypair or sign a message.
106+
This library was not designed with security in mind. If you are processing
107+
data that needs to be protected we suggest you use a quality wrapper around
108+
OpenSSL. [pyca/cryptography](https://cryptography.io) is one example of such
109+
a wrapper. The primary use-case of this library is as a portable library for
110+
interoperability testing and as a teaching tool.
111+
112+
**This library does not protect against side channel attacks.**
113+
114+
Do not allow attackers to measure how long it takes you to generate a keypair
115+
or sign a message. Do not allow attackers to run code on the same physical
116+
machine when keypair generation or signing is taking place (this includes
117+
virtual machines). Do not allow attackers to measure how much power your
118+
computer uses while generating the keypair or signing a message. Do not allow
119+
attackers to measure RF interference coming from your computer while generating
120+
a keypair or signing a message. Note: just loading the private key will cause
121+
keypair generation. Other operations or attack vectors may also be
122+
vulnerable to attacks. **For a sophisticated attacker observing just one
123+
operation with a private key will be sufficient to completely
124+
reconstruct the private key**.
125+
126+
Please also note that any Pure-python cryptographic library will be vulnerable
127+
to the same side channel attacks. This is because Python does not provide
128+
side-channel secure primitives (with the exception of
129+
[`hmac.compare_digest()`][3]), making side-channel secure programming
130+
impossible.
131+
108132
This library depends upon a strong source of random numbers. Do not use it on
109-
a system where os.urandom() is weak.
133+
a system where `os.urandom()` does not provide cryptographically secure
134+
random numbers.
135+
136+
[3]: https://docs.python.org/3/library/hmac.html#hmac.compare_digest
110137

111138
## Usage
112139

0 commit comments

Comments
 (0)