
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@towns-protocol/olm
Advanced tools
An implementation of the Double Ratchet cryptographic ratchet
Note: before using any of the olm functions, you must call initAsync()
, and
wait for the promise to resolve, otherwise you will get errors like:
Uncaught TypeError: Olm.Account is not a constructor
Example:
import Olm from "@towns-protocol/olm";
await Olm.initAsync();
const alice = new Olm.Account();
alice.create();
const bob = new Olm.Account();
bob.create();
bob.generate_one_time_keys(1);
const bobs_id_keys = JSON.parse(bob.identity_keys());
const bobs_id_key = bobs_id_keys.curve25519;
let bobs_ot_key;
for (const key in bobs_ot_keys.curve25519) {
bobs_ot_key = bobs_ot_keys.curve25519[key];
}
const alice_session = new Olm.Session();
alice_session.create_outbound(alice, bobs_id_key, bobs_ot_key);
const alice_message = alice_session.encrypt("Hello");
const bob_session = new Olm.Session();
bob_session.create_inbound(bob, alice_message);
const plaintext = bob_session.decrypt(alice_message.type, alice_message);
bob.remove_one_time_keys(bob_session);
Group chat:
import Olm from "@towns-protocol/olm";
await Olm.initAsync();
const outbound_session = new Olm.OutboundGroupSession();
outbound_session.create();
// exchange these over a secure channel
const session_id = group_session.session_id();
const session_key = group_session.session_key();
const message_index = group_session.message_index();
const inbound_session = new Olm.InboundGroupSession();
inbound_session.create(message_index, session_key);
const ciphertext = outbound_session.encrypt("Hello");
const plaintext = inbound_session.decrypt(ciphertext);
FAQs
An implementation of the Double Ratchet cryptographic ratchet
We found that @towns-protocol/olm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.