News: This forum is now permanently frozen.
Pages: [1]
Topic: Less characters in vouchers?  (Read 4477 times)
« on: October 22, 2007, 13:25:25 »
monomartin *
Posts: 1

Is it possible to limit the number of characters in vouchers?
I would like to have less than 13 characters...

Thanks and greetings
Martin
« Reply #1 on: October 28, 2007, 07:00:50 »
mwiget *
Posts: 38

Yes. You need shorter public and private key and adjust the number of bits for # of rolls, vouchers checksum etc. The following shell script will create a 40 bit key pair to be used:

#!/bin/sh
#
echo Creating new 40 bit public and private RSA keys
openssl genrsa 40 >voucher.private.new
openssl rsa -pubout <voucher.private.new >voucher.public.new
ls -l voucher.private.new voucher.public.new

copy paste the resulting keys into the voucher GUI, then use e.g. the following values:

number of roll bits: 16
number of ticket bits: 12
checksum bits: 7
magic number bits: 4

(16+12+7+4)=39 bits total

Depending on the character set used (more characters will also make shorter vouchers), you'll end up with voucher key length around 8 characters


« Reply #2 on: November 30, 2007, 11:55:07 »
JohnF *
Posts: 1

Hello

Thanks mwiget for the great feature. I find it works fine except that  8 characters are as much as some users can handle comfortably.

Can anyone suggest a way of generating 40-bit keys for us windows dummies? I tried both openSSH and Putty but they would not allow me to make keys smaller than 256-bit.

Thanks
« Reply #3 on: November 30, 2007, 13:06:10 »
mwiget *
Posts: 38

You can do this via m0n0wall's exec.php script:

http://<your-m0n0wall-ip>/exec.php

Enter '/usr/local/bin/voucher -g 40' as Command and hit execute. You'll get something similar to this:

$ /usr/local/bin/voucher -g 40
-----BEGIN RSA PRIVATE KEY-----
MDACAQACBgDJ/KivpQIDAQABAgUW1nk9GQIDDqGjAgMNzhcCAwmrzwIDC9gZAgMO
GXQ=
-----END RSA PRIVATE KEY-----
-----BEGIN PUBLIC KEY-----
MCEwDQYJKoZIhvcNAQEBBQADEAAwDQIGAMn8qK+lAgMBAAE=
-----END PUBLIC KEY-----


Copy paste both keys into the voucher configuration screen (best to save them first into a document as the key changes everytime you generate them).

Different key sizes can be specified of course.
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines