bgc_hmac.pl - Bank Giro Centralen HMAC algorithm
bgc_hmac.pl <options>
<--keyfile <filename>> key to seal with, 128 bit key encoded in hex
[--infile <filename>] file to seal ( if not set stdin )
[--outfile <filename>] sealed file ( if not set stdout )
[--date <YYMMDD>] added in the opening and tamper protection records if not set the date of the execution is set
[--test] execute a self test
[--help] display help and usage information
bgc_hmac.pl implements functionality to seal a file to be sent to BGC See the following urls http://www.bgc.se/upload/Gemensamt/Trycksaker/Manualer/BG9311.pdf For more information about BGC HMAC, visit the website www.bgc.se/hmac or contact BGC at: hmac-sigill@bgc.se The source code is in charset encoding ISO-8859-1 The files that should be sealed should be in charset encoding ISO-8859-1 The line separator should be CRLF for the files to be sealed
The command "cpanp" (CPANPLUS) may be used in cygwin to install the Digest::SHA perl module
Tripple check your keyfile, it should not contain CRLF and have the correct length
0 success anything else indicates failure
if executed from within Eclipse using EPIC using cygwin perl the arguments may look like this --infile /cygdrive/c/Users/frost/workspace/bgc_hmac/src/in.txt --keyfile /cygdrive/c/Users/frost/workspace/bgc_hmac/src/key.txt --outfile /cygdrive/c/Users/frost/workspace/bgc_hmac/src/out.txt
This code is licensed under any of the following
bgc_hmac.pl is Copyright (C) 2011 Otto Frost
Otto Frost email: hotmail.com username@hotmail.com: ecsfros fool the spammers...
And the home page from 1994 http://www.df.lth.se/~frost
A java version is available as well, but not for free. Contact the author for more information.
Larry Wall and the authors of perl for delivering an excellent product Mark Shelor <mshelor@cpan.org> for providing the Digest::SHA perl module
use utf8; # tell perl the source is in UTF-8, don't do this for bgc_hmac.pl but instead keep the source in ISO-8859-1
This code has been tested with
http://search.cpan.org/~mshelor/Digest-SHA-5.50/lib/Digest/SHA.pm $ perl --version
This is perl, v5.10.1 (*) built for i686-cygwin-thread-multi-64int (with 13 registered patches, see perl -V for more detail)
Copyright 1987-2009, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Windows Vista Business Edition
Development has been done on the Eclipse IDE using the EPIC plugin