Project

extid

0.0
No release in over a year
It can be valuable to internally use a serial integer as an ID without revealing that ID to the outside world. extid uses AES-128 to convert to and from an external ID that cannot feasibly be decoded without the secret key.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

ExtID

It can be valuable to internally use a serial integer as an ID without revealing that ID to the outside world. extid uses AES-128 to convert to and from an external ID that cannot feasibly be decoded without the secret key.

This prevents outsiders from quantifying the usage of your application by observing the rate of increase of IDs as well as provides protection against brute force crawling of all resources.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add extid

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install extid

Usage

require 'extid'

prefix = "user"
key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].pack('C*')
type = ExtID::Type.new prefix, key
type.encode(1) # => "user_13189a6ae4ab07ae70a3aabd30be99de"
type.decode("user_13189a6ae4ab07ae70a3aabd30be99de") # => 1

Other Implementations