GnuPG Summer Riddle 2007 [SOLUTION]
Sascha Wilde
wilde at sha-bang.de
Sat Jan 26 20:37:02 CET 2008
Ingo Klöcker <kloecker at kde.org> wrote:
> On Friday 25 January 2008, Sascha Wilde wrote:
>> Ingo Klöcker <kloecker at kde.org> wrote:
>> > On Thursday 24 January 2008, Sascha Wilde wrote:
>> >> SPOILER WARNING - SPOILER WARNING - SPOILER WARNING - SPOILER
>> >>
>> >> SOLUTION
>> >>
>> >> SPOILER WARNING - SPOILER WARNING - SPOILER WARNING - SPOILER
> For the fun of it I've written a generator for python apps printing an
> arbitrary string. All generated apps verify against the attached
> signature file. And as a plus each generated app is again a generator,
> i.e. the generator is self-replicating (albeit in the most simple way).
Sweet! Sure enough I had to write a version in common lisp, which I
attached (including sig of cause).
New features/changes in the lisp implementation:
1. It's a real quine -- so it generates its source in stead of copying
from the source-file.
2. Instead of printing a simple string the generated app can execute any
arbitrary lisp form. :-)
Ok, here is the usage example:
wilde at kenny% sbcl --noinform --no-userinit --load app-generator.lisp >app2.lisp
(dotimes (n 10) (format t "~a~%" n))
wilde at kenny% sbcl --noinform --no-userinit --load app2.lisp
0
1
2
3
4
5
6
7
8
9
And of cause one sig fits all:
wilde at kenny% gpg2 --verify app-generator.lisp.sig app-generator.lisp
gpg: Signature made Sat Jan 26 19:55:27 2008 CET using DSA key ID 69115024
gpg: Good signature from "Sascha Wilde <swilde at sha-bang.de>"
gpg: aka "Sascha Wilde <wilde at sha-bang.de>"
wilde at kenny% gpg2 --verify app-generator.lisp.sig app2.lisp
gpg: Signature made Sat Jan 26 19:55:27 2008 CET using DSA key ID 69115024
gpg: Good signature from "Sascha Wilde <swilde at sha-bang.de>"
gpg: aka "Sascha Wilde <wilde at sha-bang.de>"
And here are the files:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: app-generator.lisp
Type: application/octet-stream
Size: 1013 bytes
Desc: not available
URL: </pipermail/attachments/20080126/8fef623b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: app-generator.lisp.sig
Type: application/octet-stream
Size: 65 bytes
Desc: not available
URL: </pipermail/attachments/20080126/8fef623b/attachment-0001.obj>
-------------- next part --------------
cheers
sascha
--
Sascha Wilde
"Computers are good at following instructions,
but not at reading your mind."
D. E. Knuth, The TeXbook, Addison-Wesley 1984, 1986, 1996, p. 9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: </pipermail/attachments/20080126/8fef623b/attachment.pgp>
More information about the Gnupg-users
mailing list