請原諒我的無知。我沒有很好地閱讀Python,我根本寫不出來。如何確定導入的來源?
我想審覈CVE-2013-1445的python項目。我相信找到一個可能需要關注的源文件(以及其他改進機會)。該文件是util.py,具有行:
import base64
from Crypto.Hash import HMAC
from Crypto import Random
...
當我看Python crypto docs,我沒有看到一個Random
類的記載。只有hashlib
和hmac
:
The modules described in this chapter implement various algorithms of a
cryptographic nature. They are available at the discretion of the
installation. On Unix systems, the crypt module may also be available.
Here’s an overview:
15.1. hashlib — Secure hashes and message digests
15.2. hmac — Keyed-Hashing for Message Authentication
...
凡正是被Random
哪裏來的?它是原生還是第三方?
或者我的問題是,Crypto
從哪裏來?如果其第三方Crypto
,我如何確定第三方庫和類的包含方式(與本地庫和類)?爲了完整起見,我嘗試瞭解Python的作用域和命名空間,但是現在對我來說沒有任何意義(正如這個問題可能演示的那樣)。例如,對於Crypto
或Random
(Random
是Crypto
的一部分)沒有明顯的作用域或名稱空間。
在此先感謝。
[加密](https://pypi.python.org/pypi/pycrypto)是不是一個標準庫模塊。 – falsetru