Code Monkey home page Code Monkey logo

crumbl's Introduction

crumbl

Command line tool for reading and writing encoded or encrypted Rails sessions

Build Status

Installation

gem install crumbl

Usage

$ crumbl help
Commands:
  crumbl decode [COOKIE]              # Decode a Rails 3 cookie [COOKIE]
  crumbl decrypt [KEY BASE] [COOKIE]  # Decrypt Rails 4 [COOKIE] using secret key base [KEY BASE]
  crumbl encode [KEY]                 # Encode [DATA] as a Rails 3 cookie signed with secret key [KEY]
  crumbl encrypt [KEY BASE]           # Encrypt Rails 4 [DATA] using secret key base [KEY BASE]
  crumbl help [COMMAND]               # Describe available commands or one specific command

Decrypt Rails 4 encrypted cookie:

$ crumbl decrypt "secret key base" V25qdmEwZVp3ME9HNXU5ZkxzM2srQlFrcU1FQ3dGYit1YmtlRVVnVVRROD0tLTI0U2t1cXZhNDhucGtxMnIyVTFXN2c9PQ==--62bb4aa196b53de5cc993e6377be37d704aaf372
{:session_type=>"user"}

Encrypt Rails 4 cookie:

$ crumbl encrypt "secret key base"
Data to encrypt: 
crumbl> {:session_type=>"admin"}
=> Z1FpV2FHRjVXQmtRQUJiamo4Vm1XSThpK0xVMlVNSUVFblpRODAvcFA0WT0tLWNlSW4zdzM1VGNmNHZNR1pSVUxMaUE9PQ==--da1cab0cf5b4a6429c9afba06294dcee5da32172

Decode Rails 3 signed cookie:

$ crumbl decode BAhJIhx7OnNlc3Npb25fdHlwZT0+InVzZXIifQY6BkVU--63891186505fa396a865465f46f904dba0423df0
{:session_type=>"user"}

Encode Rails 3 signed cookie:

$ crumbl encode "signing key"
Data to encode: 
crumbl> {:session_type=>"admin"}
=> BAhJIh17OnNlc3Npb25fdHlwZT0+ImFkbWluIn0GOgZFVA==--4f4881f111cd39dc06b8189580088b1472daf045

Options

JSON Input:

$ crumbl encrypt "secret key base"
Data to encrypt: 
crumbl> {"allowed_ip": "1.2.3.4"}
=> K0hjc1FYdW9hUWVkRFA2MFhHVFE4dmhWalVCSndITWtlanhVRW1ZYmM3TT0tLXhvQm1EZWZhRnZLT3E3SFgzQTFhU3c9PQ==--b9e14fdf3c4f216824a3336079853b63cbaf5d47

crumbl's People

Contributors

dlanner avatar jackbot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.