{"id":17133652,"url":"https://github.com/mjc-gh/message_verifier","last_synced_at":"2025-10-23T19:12:23.395Z","repository":{"id":57638145,"uuid":"71857211","full_name":"mjc-gh/message_verifier","owner":"mjc-gh","description":"🔏 Rust Message Verifier library compatible with Rails' MessageVerifier and MessageEncryptor","archived":false,"fork":false,"pushed_at":"2024-11-11T20:07:22.000Z","size":48,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T19:32:49.170Z","etag":null,"topics":["activesupport","encryption","message-encryptor","message-verifier","rails","rust","session-cookie"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjc-gh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-10-25T03:49:09.000Z","updated_at":"2024-11-11T20:07:26.000Z","dependencies_parsed_at":"2024-01-05T00:31:54.206Z","dependency_job_id":"c03ce8c5-549a-4733-9810-9a8c71ae7ef5","html_url":"https://github.com/mjc-gh/message_verifier","commit_stats":null,"previous_names":["mikeycgto/message_verifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjc-gh%2Fmessage_verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjc-gh%2Fmessage_verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjc-gh%2Fmessage_verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjc-gh%2Fmessage_verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjc-gh","download_url":"https://codeload.github.com/mjc-gh/message_verifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688542,"owners_count":21145763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activesupport","encryption","message-encryptor","message-verifier","rails","rust","session-cookie"],"created_at":"2024-10-14T19:42:41.782Z","updated_at":"2025-10-23T19:12:18.356Z","avatar_url":"https://github.com/mjc-gh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# message_verifier\n\n[![message_verifier](https://github.com/mjc-gh/message_verifier/actions/workflows/actions.yml/badge.svg)](https://github.com/mjc-gh/message_verifier/actions/workflows/actions.yml)\n[![Crates.io Version](https://img.shields.io/crates/v/message_verifier)](https://crates.io/crates/message_verifier)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)\n\nMessage Verifier library compatible with Rails' [MessageVerifier](\nhttp://api.rubyonrails.org/classes/ActiveSupport/MessageVerifier.html)\nand\n[MessageEncryptor](\nhttp://api.rubyonrails.org/classes/ActiveSupport/MessageEncryptor.html).\n\nIn a nutshell, this library provides several simple interfaces for\nsigning and encrypting messages. These interfaces are useful when\nsecurely implementing various web application features like session\ncookies or signed URL tokens.\n\nThis library handles all the formatting, encoding, and cryptography. It\ndoes not handle serialization aspects. The idea is to input and output\nraw strings to and from this library and handle serialization on another\nlayer.\n\n### Documentation\n\nDocumentation is available on [Docs.rs](https://docs.rs/message_verifier).\n\n\n### A Small Example\n\n```\n extern crate message_verifier;\n\n use message_verifier::{Verifier, Encryptor, AesHmacEncryptor, DerivedKeyParams};\n\n fn main() {\n     let key_base = \"helloworld\";\n     let salt = \"test salt\";\n     let sign_salt = \"test signed salt\";\n\n     let verifier = Verifier::new(key_base);\n\n     //let dkp = DerivedKeyParams::default();\n     //let encryptor = AesHmacEncryptor::new(key_base, salt, sign_salt, dkp).unwrap();\n\n     let message = \"{\\\"key\\\":\\\"value\\\"}\";\n\n     println!(\"{}\", verifier.generate(message).expect(\"Verifier failed\"));\n     //println!(\"{}\", encryptor.encrypt_and_sign(message).expect(\"Encryptor failed\"));\n }\n```\n\n### More Examples\n\nThe examples directory contains two Rust examples as well as two small\nRuby scripts to demonstrate interoperability between this library and\nActiveSupport.\n\nOne Rust example demonstrates message signing and encryption:\n\n```sh\n$ cargo run --example generate_encrypt\neyJrZXkiOiJ2YWx1ZSJ9--fa115453dbb4a28277b1ba07ef4c7437621f5d72\nMllIRUYvUFhjcXBpRk9NUWgvZ2s2UT09LS1NRmN2b2Y5SWJsaUpRNlptZFdwSlZRPT0=--2df97d947a5dc344de003715510002503fa059f1\n```\n\nThe second reads from stdin and tries verify the first line of input and\ndecrypt and verify the second:\n\n```sh\n$ cargo run --example generate_encrypt | cargo run --example verify_decrypt\nVerified Message: {\"key\":\"value\"}\nDecrypted Message: {\"key\":\"value\"}\n```\n\nWe can use these two Rust examples with the Ruby scripts as well:\n\n```sh\n$ cargo run --example generate_encrypt | ruby examples/verify_decrypt.rb\nVerified message: {\"key\"=\u003e\"value\"}\nDecrypted message: {\"key\"=\u003e\"value\"}\n\n$ ruby examples/generate_encrypt.rb | cargo run --example verify_decrypt\nVerified Message: {\"key\":\"value\"}\nDecrypted Message: {\"key\":\"value\"}\n```\n\n### Supported Ciphers\n\n- AES-CBC with HMAC-SHA1\n  - 256, 192, or 128 bit keys\n- AES-GCM\n  - 256, 192, or 128 bit keys\n\nIf you need more cipher options, please open an issue or submit a PR!\n\n## Contributors\n\n- [mjc-gh](https://github.com/mjc-gh/)\n- [seanlinsley](https://github.com/seanlinsley)\n- [endoze](https://github.com/endoze)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjc-gh%2Fmessage_verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjc-gh%2Fmessage_verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjc-gh%2Fmessage_verifier/lists"}