問題タブ [kdf]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - PasswordDeriveBytes 機能を Python に変換する
pycryptodome の KDF モジュールを使用して、Python で PowerShell の PasswordDeriveBytes メソッドを再作成しようとしています。
私が現在渡せない主なことは、PowerShell から取得した正しい DerivedKey の結果を Python で取得することです。
パラメーター:
サンプル PowerShell コード:
結果:
*注: 上記の PowerShell コードは、https://github.com/PowerShellMafia/PowerSploit/blob/master/ScriptModification/Out-EncryptedScript.ps1から修正されています。以下の Python コードの機能を再実装しようとしています。
パイソンコード:
結果:
私が考えることができる唯一のことは、PasswordDeriveBytes の「.GetBytes」メソッドが pycryptodome の KDF モジュールとは異なる結果を生成していることです。
どんな助けでも大歓迎です。