Commit Graph
5 Commits
Author SHA1 Message Date
tomas.kracmar 05a09d82aa refactor: make the module manifest the only version source
The project version was stamped into the banner of every file and
kept in sync by Bump-Version.ps1, which rewrote them with regexes.
It had already drifted: ElysiumSettings.txt.sample still said 2.4.4.

Now that src/Elysium/Elysium.psd1 carries ModuleVersion and both the
module and the Elysium.Common.ps1 loader read $ElysiumVersion from it,
the banner "Version:" lines and Bump-Version.ps1 have no job left.
Removed both. Releasing is: change ModuleVersion, add the CHANGELOG
entry, commit, tag - documented in the README's versioning section.

AGENTS.md: project structure now lists the module layout, and agents
are told not to add version numbers back into banners.
2026-11-04 11:45:51 +01:00
tomas.kracmar 89c5e21002 fix(decrypt): read ELY2 and use PBKDF2-SHA256 to match the PowerShell side
decrypt.py could not decrypt any current export:
- It did not know the ELY2 format introduced in v2.4.6, so ELY2 files
  fell through to the legacy branch and failed.
- Its ELY1 branch called pycryptodome's PBKDF2 with the default PRF
  (HMAC-SHA1), while Extract-NTHashes.ps1 has used HMAC-SHA256 since
  ELY1 was introduced, so ELY1 files never decrypted either.

Now reads ELY2 (HMAC-SHA256 verified before decrypting, keys taken
from one 64-byte PBKDF2 output exactly like the two sequential
Rfc2898DeriveBytes.GetBytes(32) calls), ELY1, and the legacy format.
Key derivation uses stdlib hashlib.pbkdf2_hmac with the passphrase
encoded as UTF-8, matching .NET's string overload (pycryptodome
defaulted to latin-1). Padding is checked with Crypto.Util.Padding
instead of a length-byte range check.

Also: the passphrase prompt no longer echoes (getpass), an input path
not ending in .enc is refused instead of being overwritten by the
output, and failures exit non-zero.

tests/test_decrypt.py encrypts with the real Protect-FileWithAES
(extracted from Extract-NTHashes.ps1's AST, so the script body never
runs) via pwsh and decrypts with decrypt.py: ASCII and non-ASCII
passphrases round-trip; a wrong passphrase and a flipped ciphertext
bit are rejected by the HMAC check. With the old SHA1 derivation
patched back in, the test fails.
2026-11-04 09:24:37 +01:00
tomas.kracmar aa54c751c3 New updates 2025-10-10 15:09:33 +02:00
tomas.kracmar 1b47812616 Update version schema 2024-04-15 21:42:37 +02:00
tomas.kracmar 538dde8a5b Version 1.0 2024-03-22 08:35:52 +01:00