Making crypto.lsp work for Windows with GnuWin32

Started by xytroxon, January 19, 2009, 11:11:30 AM

Previous topic - Next topic

xytroxon

To get crypto.lsp to work with Windows, go to GnuWin32:

http://gnuwin32.sourceforge.net/">//http://gnuwin32.sourceforge.net/
QuoteGnuWin32 provides ports of tools with a GNU or similar open source license, to MS-Windows (Microsoft Windows 95 / 98 / ME / NT / 2000 / XP / 2003 / Vista / 2008)


Download and install the OpenSSL package.

http://gnuwin32.sourceforge.net/packages.html">//http://gnuwin32.sourceforge.net/packages.html





Edit file: C:Program Filesnewlispmodulescypto.lsp

(Note: For some strange historic reason, Windows "crypto.dll" is instead called "libeay32.dll")

(context 'crypto)

; set library to path-name of the library on your platform OS
;
(set 'files '(
"C:/Program Files/gnuwin32/bin/libeay32.dll" ;<<< add this line
"/usr/lib/libcrypto.so"
"/usr/lib/libcrypto.so.0.9.8"
"/usr/lib/libcrypto.so.0.9.7"
"/usr/lib/libcrypto.so.0.9.6"
"/usr/lib/libcrypto.so.4"
"/usr/lib/libcrypto.dylib"
))


>newlisp



>(load (string (env "NEWLISPDIR") "/modules/crypto.lsp"))



;; expected result from module manual

;; (crypto:md5 "ABC") => "902fbdd2b1df0c4f70b4a5d23525e932"



> (crypto:md5 "ABC")

"902fbdd2b1df0c4f70b4a5d23525e932"

>



;; expected result from module manual

;; (crypto:sha1 "ABC") => "3c01bdbb26f358bab27f267924aa2c9a03fcfdb8"



> (crypto:sha1 "ABC")

"3c01bdbb26f358bab27f267924aa2c9a03fcfdb8"

>



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Cyril

#1
http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2466">//http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2466 ;-)
With newLISP you can grow your lists from the right side!

xytroxon

#2
Quote from: "Cyril"http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2466">//http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2466 ;-)


I have FOUR versions of libeay32.dll :)



Date - Bytes

10/02/2007 -  806,912

10/28/2007 - 1,089,536

05/02/2007 - 1,097,728 <- earliest date is bigger than above?

09/03/2008 - 1,177,600



But not: c:/windows/system32/libeay32.dll



Also the GnuWin32 version contains the command line tool:

C:Program FilesGnuWin32binopenssl.exe



opensll.exe can encrypt/decrypt data and files with many functions not wrapped by crypto.lsp

http://www.openssl.org/docs/apps/enc.html">//http://www.openssl.org/docs/apps/enc.html



Also:

C:Program FilesGnuWin32manpdfopenssl-man.pdf

provides lots (if not cryptic) documentation.



And finally, GnuWin32 allows other Gnu programs to be used by Windows users in a controlled manor. That is, all Gnu apps are found together by the path:

C:Program FilesGnuWin32



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976