SceneGate / Ekona

.NET implementation of DS and DSi file formats
https://scenegate.github.io/Ekona/
MIT License
27 stars 1 forks source link

:sparkles: Implement modcrypt encryption, (de)encrypt ROM files and verify/generate its HMACs #23

Closed pleonex closed 2 years ago

pleonex commented 2 years ago

Description

Example

Modcrypted files inside the DSi program are automatically decrypted when using Binary2NitroRom. In a similar way, they are encrypted when using NitroRom2Binary depending on the header info value ModcryptAreaXTarget.

To manually encrypt or decrypt a file from a DSi program use:

var modcrypt = Modcrypt.Create(programInfo, area);
using var outputStream = modcrypt.Transform(inputStream);

This closes #11