mtcute/packages/crypto-node
2023-09-03 02:37:51 +03:00
..
lib fix typo 2021-05-10 22:57:09 +02:00
src chore: code quality improvements 2023-06-05 00:30:48 +00:00
tests chore: code quality improvements 2023-06-05 00:30:48 +00:00
.gitignore feat: node native addon for faster aes ige 2021-05-01 21:22:20 +03:00
binding.gyp feat: node native addon for faster aes ige 2021-05-01 21:22:20 +03:00
package.json chore: code quality improvements 2023-06-05 00:30:48 +00:00
README.md docs: removed typedoc-plugin-coverage 2022-08-28 17:56:56 +03:00
tsconfig.json chore: improved eslint config 2023-09-03 02:37:51 +03:00
typedoc.js chore: code quality improvements 2023-06-05 00:30:48 +00:00

@mtcute/crypto-node

Native extension for NodeJS that improves performance of the most used cryptographic mode in Telegram (IGE), which is not implemented by OpenSSL.

Other modes used (i.e. CBC, CTR) and hashes are supported natively by OpenSSL, and they are faster than the custom implementation, so OpenSSL will be used for them.

Installation

You will need all the pre-requisites for node-gyp. Pre-built packages are currently not available.

Then, install the package as usual. The native library will be built automatically.

Usage

import { TelegramClient } from '@mtcute/client'
import { NodeNativeCryptoProvider } from '@mtcute/crypto-node'

const tg = new TelegramClient({
    ...,
    crypto: () => new NodeNativeCryptoProvider()
})

Acknowledgments

Based on pyrogram/tgcrypto