hack のためのネタ帳, etc,,,

暗号化された Microsoft Office の Office Open XML (ECMA-376 Agile Encryption/Standard Encryption) ファイルをを Python から復号するためのうライブラリ。

公式ページ等

Install

WSL1 - Ubuntu 18.04.5 LTS

pip3 install すると以下のようにエラーになる。
$ pip3 install msoffcrypto-tool
Collecting msoffcrypto-tool
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/4c/fe/0aece2bdb469298c2db33bcd0e1477227719ae71e1e533877f12334bf145/msoffcrypto-tool-4.11.0.tar.gz
Collecting cryptography>=2.3 (from msoffcrypto-tool)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/fa/2d/2154d8cb773064570f48ec0b60258a4522490fcb115a6c7c9423482ca993/cryptography-3.4.6.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-l0m6hidv/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l0m6hidv/cryptography/
なんか setuptools_rust モジュールがないって言われてて、どうもバックエンドで使ってる cryptography が Rust を必要としているらしい。
一応、Ubuntu 18.04.5 LTS にも cryptography モジュール用意されてるんだけど、
  • python3-cryptography 2.1.4-1ubuntu1.4
ってことで、msoffcrypto-tool が要求する cryptography >= 2.3 の要件を満たしておらず、pip が拾って来てビルドしようとしてるようだ。

Ubuntu 18.04.5 LTS には setuptools-rust は収録されていないようで、
apt-cache search setuptools-rust
としても何も出て来ない。
そもそも、pip3 install で依存関係として処理してくれない時点で駄目なんじゃね?みたいな気がする。

cryptography の the installation documentation 見てみると、Building cryptography on Linux の所に、Rust installed and available. とか説明があって、
If you are on RHEL/CentOS/Fedora/Debian/Ubuntu or another distribution derived from the preceding list, then you should upgrade pip (in a virtual environment!) and attempt to install cryptography again before trying to install the Rust toolchain. These platforms will receive a binary wheel and require no compiler if you have an updated pip!

みたいなことが書いてあった。
RHEL/CentOS/Fedora/Debian/Ubuntu 他については、binary 配布してるので、
Rust toolchain 入れる前に、virtual environment で pip を upgrade して、pip3 install をもっぺん試してみろとの事。

Pythonist じゃないので virtual environment 使い方知らんがなつぅ。
python virtual environment」でググって以下のページを見つけた。
まとめると
python3 -m venv <venv-dir>
で <venv-dir> 以下に virtual environment 構築されるので、
source <venv-dir>/bin/activate
で PATH 等を bash に反映ししろとの事。
<venv-dir> は ./venv がおすすめとかなんとか。

pip の upgrade は 「upgrade pip」でググったら、以下のページを見つけた。
パッケージのアップデートは
pip3 install -U <package-name>
で出来るので pip 自身を update したい場合は
pip3 install -U pip
で OK との事。

WSL1 Ubuntu 18.04.5 LTS のバージョン
$ uname -srvmpio
Linux 4.4.0-18362-Microsoft #1049-Microsoft Thu Aug 14 12:01:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic
Ubuntu 標準の python3
$ ls
$ python3 -V; pip3 -V
Python 3.6.9
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
$ type -p python3 pip3
/usr/bin/python3
/usr/bin/pip3
virtual environment の構築と結果
$ time python3 -m venv venv

real    0m7.469s
user    0m1.578s
sys     0m1.797s
$ du -sh venv
5.8M    venv
$ source venv/bin/activate
(venv) $ python3 -V; pip3 -V
Python 3.6.9
pip 9.0.1 from /mnt/c/Users/kou/Desktop/python/venv/lib/python3.6/site-packages (python 3.6)
(venv) $ type -p python3 pip3
/mnt/c/Users/kou/Desktop/python/venv/bin/python3
/mnt/c/Users/kou/Desktop/python/venv/bin/pip3
pip の upgrade と結果
(venv) $ pip3 install -U pip
Cache entry deserialization failed, entry ignored
Collecting pip
  Using cached https://files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-21.0.1
(venv) $
(venv) $ pip3 -V
pip 21.0.1 from /mnt/c/Users/kou/Desktop/python/venv/lib/python3.6/site-packages/pip (python 3.6)
(venv) $ type -p pip3
/mnt/c/Users/kou/Desktop/python/venv/bin/pip3
msoffcrypto-tool のインストールと結果
(venv) $ pip3 install msoffcrypto-tool
Collecting msoffcrypto-tool
  Using cached msoffcrypto-tool-4.11.0.tar.gz (211 kB)
Collecting cryptography>=2.3
  Using cached cryptography-3.4.6-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
Collecting olefile>=0.45
  Using cached olefile-0.46.zip (112 kB)
Collecting cffi>=1.12
  Using cached cffi-1.14.5-cp36-cp36m-manylinux1_x86_64.whl (401 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Using legacy 'setup.py install' for msoffcrypto-tool, since package 'wheel' is not installed.
Using legacy 'setup.py install' for olefile, since package 'wheel' is not installed.
Installing collected packages: pycparser, cffi, olefile, cryptography, msoffcrypto-tool
    Running setup.py install for olefile ... done
    Running setup.py install for msoffcrypto-tool ... done
Successfully installed cffi-1.14.5 cryptography-3.4.6 msoffcrypto-tool-4.11.0 olefile-0.46 pycparser-2.20
(venv) $
(venv) $ msoffcrypto-tool --help
usage: msoffcrypto-tool [-h] (-p [PASSWORD] | -t) [-v] [infile] [outfile]

positional arguments:
  infile                Input file.
  outfile               Output file. If blank, stdout is used.

optional arguments:
  -h, --help            show this help message and exit
  -p [PASSWORD], --password [PASSWORD]
                        Password text.
  -t, --test            Test if the file is encrypted.
  -v                    Print verbose information.

という事で Rust の問題は解決。

Cygwin

公式リポジトリに 3.3.1-1 が収録済み
$ apt-cyg describe -u python3-cryptography | grep version:
version: 3.3.1-1
version: 2.6.1-1
version: 3.0-1
$ apt-cyg describe -u python36-cryptography | grep version:
version: 3.3.1-1
version: 2.6.1-1
version: 3.0-1
$ apt-cyg describe -u python37-cryptography | grep version:
version: 3.3.1-1
version: 2.6.1-1
version: 3.0-1
$ apt-cyg describe -u python38-cryptography | grep version:
version: 3.3.1-1
version: 3.0-1
Python と pip3 のバージョン
$ python3 -V; pip3 -V
Python 3.8.7
pip 21.0 from /usr/lib/python3.8/site-packages/pip (python 3.8)
cryptography の install は python3-cryptography 入れると python36-cryptography が入るので、python38-cryptography を指定する。
$ apt-cyg install python38-cryptography
...
msoffcrypto-tool のインストール
$ pip3 install msoffcrypto-tool
Collecting msoffcrypto-tool
  Using cached msoffcrypto-tool-4.11.0.tar.gz (211 kB)
Requirement already satisfied: olefile>=0.45 in /usr/lib/python3.8/site-packages (from msoffcrypto-tool) (0.46)
Requirement already satisfied: cryptography>=2.3 in /usr/lib/python3.8/site-packages (from msoffcrypto-tool) (3.3.1)
Requirement already satisfied: cffi>=1.12 in /usr/lib/python3.8/site-packages (from cryptography>=2.3->msoffcrypto-tool) (1.14.4)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3.8/site-packages (from cryptography>=2.3->msoffcrypto-tool) (1.15.0)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=2.3->msoffcrypto-tool) (2.20)
Using legacy 'setup.py install' for msoffcrypto-tool, since package 'wheel' is not installed.
Installing collected packages: msoffcrypto-tool
    Running setup.py install for msoffcrypto-tool ... done
Successfully installed msoffcrypto-tool-4.11.0
WARNING: You are using pip version 21.0; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3.8.exe -m pip install --upgrade pip' command.
$ msoffcrypto-tool -h
usage: msoffcrypto-tool [-h] (-p [PASSWORD] | -t) [-v] [infile] [outfile]

positional arguments:
  infile                Input file.
  outfile               Output file. If blank, stdout is used.

optional arguments:
  -h, --help            show this help message and exit
  -p [PASSWORD], --password [PASSWORD]
                        Password text.
  -t, --test            Test if the file is encrypted.
  -v                    Print verbose information.
って感じで cygwin 公式の cryptography 先に入れとくところに気付いてさえいれば割と苦労なかった。
Cygwin 補足
ただし pip3 に cryptography を入れさせると
...
      c/_cffi_backend.c:15:10: 致命的エラー: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      コンパイルを停止しました。
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
...
みたいにエラー出て、片っ端からバージョン下げて再試行するので終わらない。
ffi.h については
apt-cyg install libffi-devel
しとくとクリアできるけど、
$ pip3 install cryptography
Collecting cryptography
  Using cached cryptography-3.4.6.tar.gz (546 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: cffi>=1.12 in /usr/lib/python3.8/site-packages (from cryptography) (1.14.4)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.12->cryptography) (2.20)
Building wheels for collected packages: cryptography
  Building wheel for cryptography (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.8.exe /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp9m558_bt
       cwd: /tmp/pip-install-2e5ei1xl/cryptography_30bafc24a1f749ff8cdd05955bec9e17
  Complete output (149 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.cygwin-3.1.7-x86_64-3.8
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  copying src/cryptography/exceptions.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  copying src/cryptography/fernet.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  copying src/cryptography/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  copying src/cryptography/__about__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  copying src/cryptography/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat
  copying src/cryptography/hazmat/_der.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat
  copying src/cryptography/hazmat/_oid.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat
  copying src/cryptography/hazmat/_types.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/certificate_transparency.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/ocsp.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/x509
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/backends/openssl
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/bindings/openssl
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/ciphers
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/kdf
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/serialization
  creating build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography/hazmat/primitives/twofactor
  running egg_info
  writing src/cryptography.egg-info/PKG-INFO
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing requirements to src/cryptography.egg-info/requires.txt
  writing top-level names to src/cryptography.egg-info/top_level.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files found matching 'mypy.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  copying src/cryptography/py.typed -> build/lib.cygwin-3.1.7-x86_64-3.8/cryptography
  running build_ext
  generating cffi module 'build/temp.cygwin-3.1.7-x86_64-3.8/_padding.c'
  creating build/temp.cygwin-3.1.7-x86_64-3.8
  generating cffi module 'build/temp.cygwin-3.1.7-x86_64-3.8/_openssl.c'
  running build_rust

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      4) Ensure you have a recent Rust toolchain installed:
         https://cryptography.io/en/latest/installation.html#rust
      5) If you are experiencing issues with Rust for *this release only* you may
         set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
      =============================DEBUG ASSISTANCE=============================

  error: Can not find Rust compiler
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.0; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3.8.exe -m pip install --upgrade pip' command.
みたいに案の定 Rust で詰まる。
Cygwin には Rust 来てなかったはずなんだけど公式のは、どうやってここ抜けたんだろう?

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます