Device2SMS Node.js SDK (End-to-End Encrypted SMS)
The official
Node.js SDK for
Device2SMS.
This SDK sends SMS messages through your paired Android devices using
end-to-end encryption (E2EE) powered by
Google Tink.
To ensure cryptographic correctness and long-term support, the SDK uses
a
bundled Java-based Tink CLI helper for message encryption.
---
🔐 What it does
- Accepts a
Tink public keyset (Base64, binary format)
- Encrypts plaintext using
HybridEncrypt
- Outputs Base64-encoded ciphertext to stdout
- Uses
Google Tink (official Java implementation)
---
▶️ Usage
``
bash
java -jar device2sms-tink-cli.jar
`
$3
| Argument | Description |
|--------|-------------|
| publicKeysetB64
| Base64-encoded binary Tink public keyset |
| aad
| Associated Authenticated Data (AAD) |
| plaintext
| UTF-8 plaintext message |
$3
- Base64-encoded ciphertext (written to stdout)
---
🏗 Build
`
bash
mvn clean package
`
The shaded JAR will be created at:
`
target/device2sms-tink-cli-0.1.0.jar
`
Copy this file into:
`
sdk/node/bin/device2sms-tink-cli.jar
``
---
🔐 Java Tink Encryption Helper
The Node.js SDK internally uses a
small Java command-line tool
(bundled with the package) to perform encryption using
Google Tink Hybrid Encryption.
This ensures:
- Official, supported cryptography
- No reimplementation of crypto in JavaScript
- Full compatibility with Android (Tink-based) decryption
This tool is
not intended for direct end-user use.
---
📦 Runtime requirements
- Java
11 or newer
- No external configuration required
- No network access required at runtime
---
⚠️ Security notes
- Only
public keys are accepted
- No private key material is handled
- No plaintext is written to disk
- Errors are written to stderr only
---
📄 License
This tool is licensed under the same license as the Device2SMS SDKs.
---
📚 Documentation & Support
- Homepage: https://device2sms.ie
- API reference: https://docs.device2sms.ie
- Support: support@device2sms.ie