Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jolle/abitti-meb-decryptor

🔑 Decrypts files generated by oma.abitti.fi
https://github.com/jolle/abitti-meb-decryptor

Last synced: about 1 month ago
JSON representation

🔑 Decrypts files generated by oma.abitti.fi

Awesome Lists containing this project

README

        

# abitti-meb-decryptor

Decrypts meb/mex files that are generated by the oma.abitti.fi service and used by the Abitti examination OS.

## Example

```ts
import { decryptExamFile } from "abitti-meb-decryptor";
import { readFileSync } from "fs";

console.log(
decryptExamFile(
readFileSync("my-exam-file.meb"),
"my super secure passphrase",
),
);
```

## Usage

### `async decryptExamFile(encryptedFile: Buffer, password: string, signaturePublicKey?: Buffer) ⇒ DecryptedFiles`

Decrypts the given MEB/MEX file with the given password. The signatures of the inner files will be validated with a public key if a public key is given. If no public key is given, signature checking is skipped. An exam.json file (for MEB files) or an exam.xml file (for MEX files) should exist inside; otherwise, an error is thrown.

### `DecryptedFiles`

The decrypted inner files are represented as an object where the keys are the filenames of the inner files (e.g. "exam.xml") and the value is the file content as a buffer.

### `async decryptExamFileRaw(encryptedFile: Buffer, password: string, signaturePublicKey?: Buffer) ⇒ Record`

If the file structure inside the exam file changes significantly (i.e., if there isn't a exam.json/exam.xml file), it is possible to use this function as validation of the file structure is skipped here.