Skip to content


Subversion checkout URL

You can clone with
Download ZIP
skip32 (Skipjack for 32-bit numbers) for node
Branch: master
Failed to load latest commit information.
.gitignore added waf lockfile
LICENSE add back short key byte repitition logic from C++ version
package.json add back short key byte repitition logic from C++ version
test.js add back short key byte repitition logic from C++ version


Originally a node binding of the C code, this module is now a javascript port of skip32.c by Greg Rose once found here (as of March 2015 this link no longer working):

SKIP32 is a 80-bit key, 32-bit block symmetric cipher based on Skipjack. It has the uncommon properties of being fast, creating very dissimilar encrypted values for consecutive input values, and producing output of the same size as the input (32-bit). These make this cipher particularly useful for obfuscating series of 32-bit integers (e.g. auto-incremented database ids). It is probably not appropriate for general cryptography.

CF. for more discussion.


npm install skip32


git clone
cd skip32
npm link


var Skip32 = require("skip32").Skip32;

// 80-bit key is provided to constructor as array of up to 10 bytes
// (if fewer than 10 bytes are provided, they will be repeated)
var cipher = new Skip32([0x9b, 0x21, 0x96, 0xe, 0x1a, 0xcf, 0x24, 0x5f, 0x14, 0x93]);

// NOTE: unlike the objects created by crypto.createCipher,
//       a Skip32 instance can be reused an unlimited number of times

// encrypt/decrypt take and return 32-bit unsigned integers (uint32)
var e = cipher.encrypt(1);
// e == 585760678
var d = cipher.decrypt(e);
// d == 1
a = [cipher.encrypt(2), cipher.encrypt(3), cipher.encrypt(4)];
// a == [ 534177265, 2331760290, 3033114818 ]

// node's built in hash algorithms can be handy for making keys, e.g.
var key = require('crypto').createHash('md5').update("some text here").
          digest().substring(0, 10).split('').map(function (c) { return c.charCodeAt() });


  • 1.2.1 - add short key repitition logic from C++ version
  • 1.2.0 - switch to pure Javascript implementation by @imuli (should work with all versions of Node)
  • 1.1.0 - updated to work with Node 0.12.X (use 1.0.2 for earlier versions of Node)
Something went wrong with that request. Please try again.