Thursday, April 23, 2009

I already test the usb random number generator Araneus Alea I with OSX (unix bsd).

After compiling the i found errors as below:

root:/Users/amir/linux$ make
cc randomfile.c -lusb -o randomfile
randomfile.c:16:17: error: usb.h: No such file or directory
randomfile.c: In function 'main':
randomfile.c:74: error: 'usb_busses' undeclared (first use in this function)
randomfile.c:74: error: (Each undeclared identifier is reported only once
randomfile.c:74: error: for each function it appears in.)
randomfile.c:74: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:76: error: dereferencing pointer to incomplete type
randomfile.c:77: error: dereferencing pointer to incomplete type
randomfile.c:84: warning: assignment makes pointer from integer without a cast
make: *** [randomfile] Error 1

I need to configure libusb to generate usb.h and other related header files.

I edit the Makefile and alter the parameter as below:
randomfile: randomfile.c
cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile

After that make it again:

cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile
randomfile.c: In function 'main':
randomfile.c:99: warning: pointer targets in passing argument 3 of 'usb_bulk_read' differ in signedness

Phew, ignore the error. Basically its no error, but warning. After successcully compile the .c file, one binary file generated called randomfile

Let test the tools:

./randomfile 1000 > random.hex

one file generated random.hex with these:

4968550d1a5de37609488a881d8252
1bbb383cc5505e8fff079bf9544f810da2a91e949c1980e70609de23d7296d0fdf51c602c08cba2e2badc91a3584516f40bfdc22c63776b1526be3ee6efe04
104671ad00e778778e652943d2bbb6969bce1fbfa72d68d3418e0ff6e331c105f6363bfa7db2c2d37f38000e31ccd332f646586f5f94d0ec87c050febe143f1e3403ed3133458950354f271475b6
ecde36645bfd64d4f9e9fdd86a2ebe2c317604bc8c10932f7fb18818443e110fd7411a20a0a474065f6b87ea3da8aace8879c2a036f18dc1562084f509c432e7aa550a433743f36632c51af83264
9569cff8b3ab2176763d72ae3b5a4086eff4066c3f006a3cfe20597e5d69825f34a25a0a56c1535582dc4ad7e9645b39b70f59e39514a27cc07fb9695d10f3bc11d82be107857691ce9605d0b1f0
c7098540611067253ea2cef2ef047594ca57b5aeda1a2e14d5586af6f1833bc7b8c4b7567029817b51bdc08467dc5ae0d35d91f449ad9da481b4a901e8d1500156e8a8541085773588694d8e4339
de635f5af7176f49cabe700ef516a2d5c7b7446e85c0736da35b9bd2eab4ef5817d5a3e17bb8ca0f1af89a27c2b45e229f3797561424fa69aba463864aafc1a68c5f3e6631b262ab613a6af615d4
990ced11a45f316e89c1c5d76210a01dfa93a9ebea3c447176757b43032abab7963a101dc0a8b668b173ae69e3c92f6d2ca0e6748b9e43e9e33953877813b8ff30989e5bfad3df86790ab49441ed
1ff02581a88b769af61f453d8055dd565c9279d4bd040b6e1d903461c39fe8c5c65f9c5d160245351f8f63c346dc0350a8a35a99e4a7d9e0b7a16f13631896f394533895fbc2412f5917642377bf
9ee741a231b796a3455d38b539089448cdac66c538f751f44edc28b64a70e5fbe0539a3f65877394c81298d194881f964858e8c6ac220e69cc1a057ebf7d6aaa3e4abe2f786151ca77a7c9ebfe3e
8a56a6e2fbe33e981905ef071f564157318a9304b3b42d4cdf1a8bf5f55bc7363f0000690fc7b43b829891d4fa31a9ace36701f92b3ddbd4342937d2376c9e74fcb6b8e0221e9e6d5b6bfce1de7a
d6a1b398e8b90ae4907d7bca30e1a33bed715573074325107d24d8dda122c631d4f7eaf16571c6ee30a18a62abfbbcfd8311229671e4fac2341e9a00526c39576967349ae2238f170f1647d88851
ae691d968c1acaac4997c124bf24e33ccaa248506f901003d5e549c01b16d9ac0a4e330d2f6f767ffabb2a488f294e7698f4c62d7995f766ef2efdff1eff96eaecb27b22eddbcb7a61af4cb2df4d
b19f6f91b71003bbe9ff3316300bb76bcf679e02dfd9b3aa37c2720f9bb51275ca157faef5e0302748ebb0d34f7d5573343dd23b5cdce514becf26bc8f862723

rgds
Amir Haris Ahmad

Monday, April 20, 2009



The simplest way to integrate the Alea I with dnssec-keygen is to use the "randomfile" program which is provided as C source on the Alea I driver CD, and pipe its output into the standard input of the dnssec-keygen program. For example, this command will generate a 2048-bit RSA zone key for the "my" TLD:

sudo randomfile -b | dnssec-keygen -r /dev/fd/0 -a RSASHA1 -b 2048 my.

Here, the "-b" causes the randomfile program to output the randomness in binary form (which is what dnssec-keygen expects), and the "-r /dev/fd/0" causes dnssec-keygen to read randomness from standard input instead of /dev/random. Note that the randomfile program needs to be run as root unless you set up specific udev rules to give non-root users permission to access the Alea I USB device.

amir@domainregistry.my

Friday, April 17, 2009

After a while:

Next week(24 April 2009 until 1 May 2009) I will be in Sabah & Sarawak. I will represent MyNIC BHD. as presenter to talk about Domain Name System Security Extention (DNSSEC). The audiences will be government and educational institution. See you all there. For more info please visit http://rnd.domainregistry.my

Monday, April 13, 2009

Command to check duplicate entries in mysql

SELECT DISTINCT(cource_code) AS cource, COUNT(cource_code) AS Count FROM kursus_psmb GROUP BY cource_code HAVING Count > 1

Thursday, April 09, 2009

Remove all .svn folders in a directory

find
. -name ".svn" -type d -exec rm -rf {} \;