Fix up steg and net-re

This commit is contained in:
Neale Pickett 2010-10-12 16:58:34 -06:00
parent ea00976e68
commit 7fba5155b1
52 changed files with 471 additions and 221 deletions

View File

@ -67,29 +67,37 @@ for dn in $indir/[0-9]*; do
tgt=$outdir/puzzles/$points
mkdir -p $tgt
for fn in $dn/*; do
case $(basename $fn) in
key)
while read answer; do
echo $points $answer
done < $fn >> $uanswers
;;
index.mdwn)
# Handle this later
;;
*~|"#"*)
if [ -f $dn/Makefile ]; then
# If there's a makefile, run make
make -C $dn DESTDIR=$(pwd)/$tgt
files=$(cd $tgt; echo *)
else
# Otherwise, look for special files and copy the rest
files=
for fn in $dn/*; do
case $(basename $fn) in
key|index.mdwn)
# Handle these later
;;
*~|"#"*)
# Don't copy temporary or backup files
;;
,*)
;;
,*)
# Copy but don't list
cp $fn $tgt/
;;
*)
cp $fn $tgt/
files="$files $(basename $fn)"
;;
esac
done
cp $fn $tgt/
;;
*)
cp $fn $tgt/
files="$files $(basename $fn)"
;;
esac
done
fi
# Append keys
while read answer; do
echo $points $answer
done < $dn/key >> $uanswers
# Generate index now that we have a list of files
if [ -f $dn/index.mdwn ]; then

View File

@ -80,11 +80,11 @@ In order to do this, the 8-bit *byte* stream must be converted into a
*bit* stream. This bit stream must then be converted into a stream of
6-bit bytes, as in the following figure:
| 00 | 01 | AF | F0 | B4 | 14 |
| 00 | 04 | AF | F0 | 74 | 14 |
| | | | | | |
|000000 00|0000 1000|10 101111|111100 00|0111 0100|00 010100|
|000000 00|0000 0100|10 101111|111100 00|0111 0100|00 010100|
| |
|000000|00 0000|1000 10|101111|111100|00 0111|0100 00|010100|
|000000|00 0000|0100 10|101111|111100|00 0111|0100 00|010100|
| | | | | | | | |
| 00 | 00 | 12 | 2F | 3C | 07 | 10 | 14 |

View File

@ -103,10 +103,15 @@ successful attempt to skirt firewall rules.
Question
========
Sometimes as an analyst, you only get the first few dozen bytes of a
conversation, and you may not even get an indication of whether the
client or server spoke first.
What follows is a list of the first line of text sent in various
different connections. The key for this page is the comma-separated (no
spaces) list of protocols not described on this page, ordered from
lowest (1) to highest (F).
different connections. The key for this page is the list of protocols
not described on this page, ordered from lowest (1) to highest (F). In
other words, list everything that isn't the first line of an FTP, SMTP,
or HTTP connection.
1: GET / HTTP/1.1
2: +OK example.com server ready

View File

@ -1 +1,8 @@
2468ABCDF
2468abcdf
2 4 6 8 A B C D F
2 4 6 8 a b c d f
2,4,6,8,A,B,C,D,F
2,4,6,8,a,b,c,d,f
2, 4, 6, 8, A, B, C, D, F
2, 4, 6, 8, a, b, c, d, f

View File

@ -1,19 +1,24 @@
PUZZLES += basemath bletchley codebreaking compaq crypto
PUZZLES += forensics hackme net-re sequence skynet webapp
PUZZLES += steg
-include puzzles/*/*.mk
PUZZLES_SUBMAKEFILES = $(wildcard puzzles/*/*/Makefile)
PUZZLES_SUBCLEANS = $(patsubst %/Makefile, %/clean, $(PUZZLES_SUBMAKEFILES))
install: $(patsubst %, puzzles/%-install, $(PUZZLES))
puzzles/%-install:
mkdir -p build/$*
puzzles/mkpuzzles puzzles/$* build/$*
touch $@
puzzles/%-clean:
rm -rf build/$* puzzles/$*-install
%.pkg: puzzles/%-install
mksquashfs build/$* $*.pkg -all-root -noappend
packages: $(addsuffix .pkg, $(PUZZLES))
install: $(patsubst %, puzzles/%-install, $(PUZZLES))
clean: puzzles-clean
clean: $(patsubst %, puzzles/%-clean, $(PUZZLES))
puzzles-clean: $(PUZZLES_SUBCLEANS) $(patsubst %, puzzles/%-clean, $(PUZZLES))
puzzles/%/clean:
$(MAKE) -C $(@D) clean
puzzles/%-clean: $(PUZZLES_SUBCLEANS)
rm -rf build/$* puzzles/$*-install $*.pkg
packages: $(addsuffix .pkg, $(PUZZLES))

25
puzzles/steg/10/Makefile Normal file
View File

@ -0,0 +1,25 @@
IMG = http://www.myconfinedspace.com/wp-content/uploads/2006/11/bill-stickers.jpg
.DELETE_ON_ERROR:
install: file.png
cp $< $(DESTDIR)/$$(md5sum $< | awk '{print $$1;}')
src.jpg:
wget -O $@ $(IMG)
%.pbm: %.jpg
jpegtopnm $< > $@
alpha.pgm: src.pbm text.txt
echo "P5" > $@
awk '(i++ == 1) { print; }' $< >> $@
echo "255" >> $@
m4 -DKEY="$(shell cat key)" text.txt >> $@
awk 'BEGIN{for(i=0;i<500000;i++)printf("\377");}' >> $@
file.png: alpha.pgm src.pbm
pnmtopng -alpha alpha.pgm src.pbm > $@
clean:
rm -f file.png alpha.pgm src.pbm

1
puzzles/steg/10/key Normal file
View File

@ -0,0 +1 @@
We the People

BIN
puzzles/steg/10/src.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

31
puzzles/steg/10/index.exe → puzzles/steg/10/text.txt Executable file → Normal file
View File

@ -1,20 +1,3 @@
#! /bin/sh -e
key='We the People'
img=http://www.myconfinedspace.com/wp-content/uploads/2006/11/bill-stickers.jpg
wget -O src.jpg $img
jpegtopnm src.jpg > src.pbm
dim=$(awk '(i++ == 1) { print; }' src.pbm)
npixels=$(awk '(i++ == 1) { print $1 * $2; }' src.pbm)
alpha=alpha.pgm
echo "P5" > $alpha
echo $dim >> $alpha
echo "255" >> $alpha
zip - - <<EOF > alpha.zip
We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.
Article. I.
@ -237,16 +220,4 @@ This Constitution, and the Laws of the United States which shall be made in Purs
The Senators and Representatives before mentioned, and the Members of the several State Legislatures, and all executive and judicial Officers, both of the United States and of the several States, shall be bound by Oath or Affirmation, to support this Constitution; but no religious Test shall ever be required as a Qualification to any Office or public Trust under the United States.
The key is "$key".
EOF
cat alpha.zip >> $alpha
zipsize=$(du -b alpha.zip | awk '{print $1;}')
echo $npixels $zipsize
pad=$(expr $npixels - $zipsize)
dd if=/dev/urandom bs=1 count=$pad >> $alpha
pnmtopng -alpha alpha.pgm src.pbm > file.png
md5=$(md5sum file.png | awk '{print $1;}')
mv file.png $md5
rm src.* alpha.*
The key is "KEY".

34
puzzles/steg/100/Makefile Normal file
View File

@ -0,0 +1,34 @@
.DELETE_ON_ERROR:
DESTDIR ?= .
JPEGS += ww0207-43.jpg ww0870-11.jpg ww1645-44.jpg ww1646-66.jpg ww1646-78.jpg
JPEGS += ww0207-45.jpg ww0870-14.jpg ww1645-52.jpg ww1646-67.jpg ww1647-37.jpg
JPEGS += ww0207-90.jpg ww1645-22.jpg ww1645-53.jpg ww1646-69.jpg ww1647-75.jpg
JPEGS += ww0870-09.jpg ww1645-43.jpg ww1645-55.jpg ww1646-70.jpg ww1647-85.jpg
PRISTINE = $(addprefix pristine/, $(JPEGS))
NORMALIZED = $(addprefix normalized/, $(JPEGS))
install: $(DESTDIR)/file.zip
.PRECIOUS: pristine/%.jpg
pristine/%.jpg:
@mkdir -p $(@D)
wget -O $@ http://digital.library.northwestern.edu/wwii-posters/img/$*.jpg
normalized/%.jpg: pristine/%.jpg image.cmds
@mkdir -p $(@D)
cp $< $@
exiv2 -m image.cmds $@
key.png: key
pbmtext < key | pnmtopng -compression 0 > $@
$(DESTDIR)/file.zip: key.png $(NORMALIZED)
./encode $(NORMALIZED) < key.png > $@
@echo $(NORMALIZED)
clean:
rm -rf key.png $(DESTDIR)/file.zip
rm -rf normalized/

View File

@ -11,41 +11,25 @@ import md5
import sys
import zipfile
key = 'wilderness fishsticks'
srcdir = os.path.dirname(sys.argv[0])
exifblah = os.path.join(srcdir, 'image.cmds')
def system(cmd):
ret = os.system(cmd)
if ret:
raise OSError('return value %d: %s' % (ret, cmd))
# Download war posters
if not os.path.exists('ww0207-43.jpg'):
system('wget -r -D digital.library.northwestern.edu -A jpg -nd -l 2 "http://digital.library.northwestern.edu/otcgi/digilib/llscgi60.exe?mode=phrase&query=conserve&REGION=&SIZE=20&db=0"')
os.unlink('robots.txt')
# Read in key image
key_png = sys.stdin.read()
# Store the key
open('key', 'w').write(key)
# Make a PNG of it
f = os.popen('pbmtext < key | pnmtopng -compression 0')
key_png = f.read()
# Duplicate two photos
jpegs = glob.glob('*.jpg')
# Duplicate two photos, give them a chance to bindiff
jpegs = sys.argv[1:]
random.shuffle(jpegs)
for fn in jpegs[:2]:
root, ext = os.path.splitext(fn)
nfn = '%s.dup%s' % (root, ext)
shutil.copy(fn, nfn)
jpegs.append(nfn)
jpegs.append(fn)
random.shuffle(jpegs)
bytes_per_photo = len(key_png) / len(jpegs)
zipf = zipfile.ZipFile('archive.zip', 'w')
zipf = zipfile.ZipFile(sys.stdout, 'w')
for i in range(len(jpegs)):
fn = jpegs[i]
@ -59,8 +43,6 @@ for i in range(len(jpegs)):
bytes_str = ' '.join(str(ord(c)) for c in bytes)
cmd2 = 'set Exif.Canon.0x0018 "%s"' % bytes_str
# First set some defaults
system('exiv2 -m %s %s' % (exifblah, fn))
# Now apply our devious stuff
system('exiv2 -M\'%s\' -M\'%s\' %s' % (cmd1, cmd2, fn))
@ -75,6 +57,3 @@ for i in range(len(jpegs)):
zi.compress_type = zipfile.ZIP_DEFLATED
zi.external_attr = 0644 << 16L
zipf.writestr(zi, contents)
# We're done with this file
os.unlink(fn)

1
puzzles/steg/100/key Normal file
View File

@ -0,0 +1 @@
wilderness fishsticks

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

25
puzzles/steg/15/Makefile Normal file
View File

@ -0,0 +1,25 @@
IMG = http://woozle.org/~neale/images/starwarsplan.jpg
.DELETE_ON_ERROR:
install: file.png
cp $< $(DESTDIR)/$$(md5sum file.png | awk '{print $$1;}')
src.jpg:
wget -O $@ $(IMG)
%.pbm: %.jpg
jpegtopnm $< > $@
alpha.pgm: src.pbm text.txt
echo "P5" > $@
awk '(i++ == 1) { print; }' $< >> $@
echo "255" >> $@
m4 -DKEY="$(shell cat key)" text.txt | zip - - >> $@
awk 'BEGIN{for(i=0;i<500000;i++)printf("\377");}' >> $@
file.png: alpha.pgm src.pbm
pnmtopng -alpha alpha.pgm src.pbm > $@
clean:
rm -f file.png alpha.pgm src.pbm

1
puzzles/steg/15/key Normal file
View File

@ -0,0 +1 @@
Share the software

BIN
puzzles/steg/15/src.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

187
puzzles/steg/15/text.txt Normal file
View File

@ -0,0 +1,187 @@
What's GNU? Gnu's Not Unix!
GNU, which stands for Gnu's Not Unix, is the name for the complete Unix-compatible software system which I am writing so that I can give it away free to everyone who can use it. (1) Several other volunteers are helping me. Contributions of time, money, programs and equipment are greatly needed.
So far we have an Emacs text editor with Lisp for writing editor commands, a source level debugger, a yacc-compatible parser generator, a linker, and around 35 utilities. A shell (command interpreter) is nearly completed. A new portable optimizing C compiler has compiled itself and may be released this year. An initial kernel exists but many more features are needed to emulate Unix. When the kernel and compiler are finished, it will be possible to distribute a GNU system suitable for program development. We will use TeX as our text formatter, but an nroff is being worked on. We will use the free, portable X window system as well. After this we will add a portable Common Lisp, an Empire game, a spreadsheet, and hundreds of other things, plus on-line documentation. We hope to supply, eventually, everything useful that normally comes with a Unix system, and more.
GNU will be able to run Unix programs, but will not be identical to Unix. We will make all improvements that are convenient, based on our experience with other operating systems. In particular, we plan to have longer file names, file version numbers, a crashproof file system, file name completion perhaps, terminal-independent display support, and perhaps eventually a Lisp-based window system through which several Lisp programs and ordinary Unix programs can share a screen. Both C and Lisp will be available as system programming languages. We will try to support UUCP, MIT Chaosnet, and Internet protocols for communication.
GNU is aimed initially at machines in the 68000/16000 class with virtual memory, because they are the easiest machines to make it run on. The extra effort to make it run on smaller machines will be left to someone who wants to use it on them.
To avoid horrible confusion, please pronounce the `G' in the word `GNU' when it is the name of this project.
Why I Must Write GNU
I consider that the golden rule requires that if I like a program I must share it with other people who like it. Software sellers want to divide the users and conquer them, making each user agree not to share with others. I refuse to break solidarity with other users in this way. I cannot in good conscience sign a nondisclosure agreement or a software license agreement. For years I worked within the Artificial Intelligence Lab to resist such tendencies and other inhospitalities, but eventually they had gone too far: I could not remain in an institution where such things are done for me against my will.
So that I can continue to use computers without dishonor, I have decided to put together a sufficient body of free software so that I will be able to get along without any software that is not free. I have resigned from the AI lab to deny MIT any legal excuse to prevent me from giving GNU away.
Why GNU Will Be Compatible with Unix
Unix is not my ideal system, but it is not too bad. The essential features of Unix seem to be good ones, and I think I can fill in what Unix lacks without spoiling them. And a system compatible with Unix would be convenient for many other people to adopt.
How GNU Will Be Available
GNU is not in the public domain. Everyone will be permitted to modify and redistribute GNU, but no distributor will be allowed to restrict its further redistribution. That is to say, proprietary modifications will not be allowed. I want to make sure that all versions of GNU remain free.
Why Many Other Programmers Want to Help
I have found many other programmers who are excited about GNU and want to help.
Many programmers are unhappy about the commercialization of system software. It may enable them to make more money, but it requires them to feel in conflict with other programmers in general rather than feel as comrades. The fundamental act of friendship among programmers is the sharing of programs; marketing arrangements now typically used essentially forbid programmers to treat others as friends. The purchaser of software must choose between friendship and obeying the law. Naturally, many decide that friendship is more important. But those who believe in law often do not feel at ease with either choice. They become cynical and think that programming is just a way of making money.
By working on and using GNU rather than proprietary programs, we can be hospitable to everyone and obey the law. In addition, GNU serves as an example to inspire and a banner to rally others to join us in sharing. This can give us a feeling of harmony which is impossible if we use software that is not free. For about half the programmers I talk to, this is an important happiness that money cannot replace.
How You Can Contribute
I am asking computer manufacturers for donations of machines and money. I'm asking individuals for donations of programs and work.
One consequence you can expect if you donate machines is that GNU will run on them at an early date. The machines should be complete, ready to use systems, approved for use in a residential area, and not in need of sophisticated cooling or power.
I have found very many programmers eager to contribute part-time work for GNU. For most projects, such part-time distributed work would be very hard to coordinate; the independently-written parts would not work together. But for the particular task of replacing Unix, this problem is absent. A complete Unix system contains hundreds of utility programs, each of which is documented separately. Most interface specifications are fixed by Unix compatibility. If each contributor can write a compatible replacement for a single Unix utility, and make it work properly in place of the original on a Unix system, then these utilities will work right when put together. Even allowing for Murphy to create a few unexpected problems, assembling these components will be a feasible task. (The kernel will require closer communication and will be worked on by a small, tight group.)
If I get donations of money, I may be able to hire a few people full or part time. The salary won't be high by programmers' standards, but I'm looking for people for whom building community spirit is as important as making money. I view this as a way of enabling dedicated people to devote their full energies to working on GNU by sparing them the need to make a living in another way.
Why All Computer Users Will Benefit
Once GNU is written, everyone will be able to obtain good system software free, just like air. (2)
This means much more than just saving everyone the price of a Unix license. It means that much wasteful duplication of system programming effort will be avoided. This effort can go instead into advancing the state of the art.
Complete system sources will be available to everyone. As a result, a user who needs changes in the system will always be free to make them himself, or hire any available programmer or company to make them for him. Users will no longer be at the mercy of one programmer or company which owns the sources and is in sole position to make changes.
Schools will be able to provide a much more educational environment by encouraging all students to study and improve the system code. Harvard's computer lab used to have the policy that no program could be installed on the system if its sources were not on public display, and upheld it by actually refusing to install certain programs. I was very much inspired by this.
Finally, the overhead of considering who owns the system software and what one is or is not entitled to do with it will be lifted.
Arrangements to make people pay for using a program, including licensing of copies, always incur a tremendous cost to society through the cumbersome mechanisms necessary to figure out how much (that is, which programs) a person must pay for. And only a police state can force everyone to obey them. Consider a space station where air must be manufactured at great cost: charging each breather per liter of air may be fair, but wearing the metered gas mask all day and all night is intolerable even if everyone can afford to pay the air bill. And the TV cameras everywhere to see if you ever take the mask off are outrageous. It's better to support the air plant with a head tax and chuck the masks.
Copying all or parts of a program is as natural to a programmer as breathing, and as productive. It ought to be as free.
Some Easily Rebutted Objections to GNU's Goals
"Nobody will use it if it is free, because that means they can't rely on any support."
"You have to charge for the program to pay for providing the support."
If people would rather pay for GNU plus service than get GNU free without service, a company to provide just service to people who have obtained GNU free ought to be profitable. (3)
We must distinguish between support in the form of real programming work and mere handholding. The former is something one cannot rely on from a software vendor. If your problem is not shared by enough people, the vendor will tell you to get lost.
If your business needs to be able to rely on support, the only way is to have all the necessary sources and tools. Then you can hire any available person to fix your problem; you are not at the mercy of any individual. With Unix, the price of sources puts this out of consideration for most businesses. With GNU this will be easy. It is still possible for there to be no available competent person, but this problem cannot be blamed on distribution arrangements. GNU does not eliminate all the world's problems, only some of them.
Meanwhile, the users who know nothing about computers need handholding: doing things for them which they could easily do themselves but don't know how.
Such services could be provided by companies that sell just hand-holding and repair service. If it is true that users would rather spend money and get a product with service, they will also be willing to buy the service having got the product free. The service companies will compete in quality and price; users will not be tied to any particular one. Meanwhile, those of us who don't need the service should be able to use the program without paying for the service.
"You cannot reach many people without advertising, and you must charge for the program to support that."
"It's no use advertising a program people can get free."
There are various forms of free or very cheap publicity that can be used to inform numbers of computer users about something like GNU. But it may be true that one can reach more microcomputer users with advertising. If this is really so, a business which advertises the service of copying and mailing GNU for a fee ought to be successful enough to pay for its advertising and more. This way, only the users who benefit from the advertising pay for it.
On the other hand, if many people get GNU from their friends, and such companies don't succeed, this will show that advertising was not really necessary to spread GNU. Why is it that free market advocates don't want to let the free market decide this? (4)
"My company needs a proprietary operating system to get a competitive edge."
GNU will remove operating system software from the realm of competition. You will not be able to get an edge in this area, but neither will your competitors be able to get an edge over you. You and they will compete in other areas, while benefiting mutually in this one. If your business is selling an operating system, you will not like GNU, but that's tough on you. If your business is something else, GNU can save you from being pushed into the expensive business of selling operating systems.
I would like to see GNU development supported by gifts from many manufacturers and users, reducing the cost to each. (5)
"Don't programmers deserve a reward for their creativity?"
If anything deserves a reward, it is social contribution. Creativity can be a social contribution, but only in so far as society is free to use the results. If programmers deserve to be rewarded for creating innovative programs, by the same token they deserve to be punished if they restrict the use of these programs.
"Shouldn't a programmer be able to ask for a reward for his creativity?"
There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive. But the means customary in the field of software today are based on destruction.
Extracting money from users of a program by restricting their use of it is destructive because the restrictions reduce the amount and the ways that the program can be used. This reduces the amount of wealth that humanity derives from the program. When there is a deliberate choice to restrict, the harmful consequences are deliberate destruction.
The reason a good citizen does not use such destructive means to become wealthier is that, if everyone did so, we would all become poorer from the mutual destructiveness. This is Kantian ethics; or, the Golden Rule. Since I do not like the consequences that result if everyone hoards information, I am required to consider it wrong for one to do so. Specifically, the desire to be rewarded for one's creativity does not justify depriving the world in general of all or part of that creativity.
"Won't programmers starve?"
I could answer that nobody is forced to be a programmer. Most of us cannot manage to get any money for standing on the street and making faces. But we are not, as a result, condemned to spend our lives standing on the street making faces, and starving. We do something else.
But that is the wrong answer because it accepts the questioner's implicit assumption: that without ownership of software, programmers cannot possibly be paid a cent. Supposedly it is all or nothing.
The real reason programmers will not starve is that it will still be possible for them to get paid for programming; just not paid as much as now.
Restricting copying is not the only basis for business in software. It is the most common basis because it brings in the most money. If it were prohibited, or rejected by the customer, software business would move to other bases of organization which are now used less often. There are always numerous ways to organize any kind of business.
Probably programming will not be as lucrative on the new basis as it is now. But that is not an argument against the change. It is not considered an injustice that sales clerks make the salaries that they now do. If programmers made the same, that would not be an injustice either. (In practice they would still make considerably more than that.)
"Don't people have a right to control how their creativity is used?"
"Control over the use of one's ideas" really constitutes control over other people's lives; and it is usually used to make their lives more difficult.
People who have studied the issue of intellectual property rights (6) carefully (such as lawyers) say that there is no intrinsic right to intellectual property. The kinds of supposed intellectual property rights that the government recognizes were created by specific acts of legislation for specific purposes.
For example, the patent system was established to encourage inventors to disclose the details of their inventions. Its purpose was to help society rather than to help inventors. At the time, the life span of 17 years for a patent was short compared with the rate of advance of the state of the art. Since patents are an issue only among manufacturers, for whom the cost and effort of a license agreement are small compared with setting up production, the patents often do not do much harm. They do not obstruct most individuals who use patented products.
The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. The copyright system was created expressly for the purpose of encouraging authorship. In the domain for which it was invented--books, which could be copied economically only on a printing press--it did little harm, and did not obstruct most of the individuals who read the books.
All intellectual property rights are just licenses granted by society because it was thought, rightly or wrongly, that society as a whole would benefit by granting them. But in any particular situation, we have to ask: are we really better off granting such license? What kind of act are we licensing a person to do?
The case of programs today is very different from that of books a hundred years ago. The fact that the easiest way to copy a program is from one neighbor to another, the fact that a program has both source code and object code which are distinct, and the fact that a program is used rather than read and enjoyed, combine to create a situation in which a person who enforces a copyright is harming society as a whole both materially and spiritually; in which a person should not do so regardless of whether the law enables him to.
"Competition makes things get done better."
The paradigm of competition is a race: by rewarding the winner, we encourage everyone to run faster. When capitalism really works this way, it does a good job; but its defenders are wrong in assuming it always works this way. If the runners forget why the reward is offered and become intent on winning, no matter how, they may find other strategies--such as, attacking other runners. If the runners get into a fist fight, they will all finish late.
Proprietary and secret software is the moral equivalent of runners in a fist fight. Sad to say, the only referee we've got does not seem to object to fights; he just regulates them ("For every ten yards you run, you can fire one shot"). He really ought to break them up, and penalize runners for even trying to fight.
"Won't everyone stop programming without a monetary incentive?"
Actually, many people will program with absolutely no monetary incentive. Programming has an irresistible fascination for some people, usually the people who are best at it. There is no shortage of professional musicians who keep at it even though they have no hope of making a living that way.
But really this question, though commonly asked, is not appropriate to the situation. Pay for programmers will not disappear, only become less. So the right question is, will anyone program with a reduced monetary incentive? My experience shows that they will.
For more than ten years, many of the world's best programmers worked at the Artificial Intelligence Lab for far less money than they could have had anywhere else. They got many kinds of non-monetary rewards: fame and appreciation, for example. And creativity is also fun, a reward in itself.
Then most of them left when offered a chance to do the same interesting work for a lot of money.
What the facts show is that people will program for reasons other than riches; but if given a chance to make a lot of money as well, they will come to expect and demand it. Low-paying organizations do poorly in competition with high-paying ones, but they do not have to do badly if the high-paying ones are banned.
"We need the programmers desperately. If they demand that we stop helping our neighbors, we have to obey."
You're never so desperate that you have to obey this sort of demand. Remember: millions for defense, but not a cent for tribute!
"Programmers need to make a living somehow."
In the short run, this is true. However, there are plenty of ways that programmers could make a living without selling the right to use a program. This way is customary now because it brings programmers and businessmen the most money, not because it is the only way to make a living. It is easy to find other ways if you want to find them. Here are a number of examples.
A manufacturer introducing a new computer will pay for the porting of operating systems onto the new hardware.
The sale of teaching, hand-holding and maintenance services could also employ programmers.
People with new ideas could distribute programs as freeware, asking for donations from satisfied users, or selling hand-holding services. I have met people who are already working this way successfully.
Users with related needs can form users' groups, and pay dues. A group would contract with programming companies to write programs that the group's members would like to use.
All sorts of development can be funded with a Software Tax:
Suppose everyone who buys a computer has to pay x percent of the price as a software tax. The government gives this to an agency like the NSF to spend on software development.
But if the computer buyer makes a donation to software development himself, he can take a credit against the tax. He can donate to the project of his own choosing--often, chosen because he hopes to use the results when it is done. He can take a credit for any amount of donation up to the total tax he had to pay.
The total tax rate could be decided by a vote of the payers of the tax, weighted according to the amount they will be taxed on.
The consequences:
* The computer-using community supports software development.
* This community decides what level of support is needed.
* Users who care which projects their share is spent on can choose this for themselves.
In the long run, making programs free is a step toward the post-scarcity world, where nobody will have to work very hard just to make a living. People will be free to devote themselves to activities that are fun, such as programming, after spending the necessary ten hours a week on required tasks such as legislation, family counseling, robot repair and asteroid prospecting. There will be no need to be able to make a living from programming.
We have already greatly reduced the amount of work that the whole society must do for its actual productivity, but only a little of this has translated itself into leisure for workers because much nonproductive activity is required to accompany productive activity. The main causes of this are bureaucracy and isometric struggles against competition. Free software will greatly reduce these drains in the area of software production. We must do this, in order for technical gains in productivity to translate into less work for us.
Footnotes
(1) The wording here was careless. The intention was that nobody would have to pay for *permission* to use the GNU system. But the words don't make this clear, and people often interpret them as saying that copies of GNU should always be distributed at little or no charge. That was never the intent; later on, the manifesto mentions the possibility of companies providing the service of distribution for a profit. Subsequently I have learned to distinguish carefully between "free" in the sense of freedom and "free" in the sense of price. Free software is software that users have the freedom to distribute and change. Some users may obtain copies at no charge, while others pay to obtain copies--and if the funds help support improving the software, so much the better. The important thing is that everyone who has a copy has the freedom to cooperate with others in using it.
(2) This is another place I failed to distinguish carefully between the two different meanings of "free". The statement as it stands is not false--you can get copies of GNU software at no charge, from your friends or over the net. But it does suggest the wrong idea.
(3) Several such companies now exist.
(4) The Free Software Foundation raises most of its funds from a distribution service, although it is a charity rather than a company. If *no one* chooses to obtain copies by ordering them from the FSF, it will be unable to do its work. But this does not mean that proprietary restrictions are justified to force every user to pay. If a small fraction of all the users order copies from the FSF, that is sufficient to keep the FSF afloat. So we ask users to choose to support us in this way. Have you done your part?
(5) A group of computer companies recently pooled funds to support maintenance of the GNU C Compiler.
(6) In the 80s I had not yet realized how confusing it was to speak of "the issue" of "intellectual property". That term is obviously biased; more subtle is the fact that it lumps together various disparate laws which raise very different issues. Nowadays I urge people to reject the term "intellectual property" entirely, lest it lead others to suppose this is one coherent issue. The way to be clear is to to discuss patents, copyrights, and trademarks separately. See the Confusing Words and Phrases that are Worth Avoiding page.
The key is "KEY".

13
puzzles/steg/20/Makefile Normal file
View File

@ -0,0 +1,13 @@
IMG = http://mfrost.typepad.com/cute_overload/images/2008/02/11/bunny.jpg
install: file.jpg
cp $< $(DESTDIR)/$$(md5sum $< | awk '{print $$1;}')
src.jpg:
wget -O src.jpg $(IMG)
file.jpg: src.jpg
cat src.jpg text.txt > $@
clean:
rm -f file.jpg

1
puzzles/steg/20/key Normal file
View File

@ -0,0 +1 @@
Molotov Cocktails

BIN
puzzles/steg/20/src.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

15
puzzles/steg/20/index.exe → puzzles/steg/20/text.txt Executable file → Normal file
View File

@ -1,14 +1,3 @@
#! /bin/sh
key='Molotov Cocktails'
img=http://mfrost.typepad.com/cute_overload/images/2008/02/11/bunny.jpg
wget -O src.jpg $img
cat src.jpg - <<EOF >img.jpg
Molotov Cocktails
=================
There are many variations of the molotov cocktail. The classic is a
glass bottle filled with gasoline. An oily soaked rag is placed in the
neck of the bottle. The rag is lit on fire and the bottle is thrown at
@ -44,6 +33,4 @@ and light the sucker. This method should be made with a plastic bottle
so that it will not break on impact. When you light it, the bottle will
quickly explode so be quick. Using a fuse is a good idea.
'$key' is the key.
EOF
"KEY" is the key.

View File

@ -0,0 +1,7 @@
.DELETE_ON_ERROR:
$(DESTDIR)/file.gz: key text.txt
./encode < key 3< text.txt > $@
clean:
rm -f $(DESTDIR)/file.gz

33
puzzles/steg/200/encode Executable file
View File

@ -0,0 +1,33 @@
#! /usr/bin/python
import sys
import os
import gzip
import md5
partlen = 8
key = sys.stdin.read().strip()
hexofkey = key.encode('hex')
garbage = os.fdopen(3).read()
keyparts = []
for i in range(0, len(hexofkey), partlen):
part = hexofkey[i:i+partlen]
keyparts.append(part)
textpartlen = len(garbage) / len(keyparts)
for i in range(len(keyparts)):
offset = i*textpartlen
if i == len(keyparts) - 1:
textpart = garbage[offset:]
else:
textpart = garbage[offset:offset+textpartlen]
fn = keyparts[i] + '.txt'
gf = gzip.GzipFile(filename=fn, mode='ab', fileobj=sys.stdout)
gf.write(textpart)
gf.close()

View File

@ -1,12 +1,4 @@
#! /usr/bin/python
import gzip
import cStringIO as StringIO
import md5
key = 'washy-eyed jeffy'
garbage = '''[Preamble] Edward by the grace of God King of England, lord of Ireland and duke of Aquitaine sends greetings to all to whom the present letters come. We have inspected the great charter of the lord Henry, late King of England, our father, concerning the liberties of England in these words:
[Preamble] Edward by the grace of God King of England, lord of Ireland and duke of Aquitaine sends greetings to all to whom the present letters come. We have inspected the great charter of the lord Henry, late King of England, our father, concerning the liberties of England in these words:
Henry by the grace of God King of England, lord of Ireland, duke of Normandy and Aquitaine and count of Anjou sends greetings to his archbishops, bishops, abbots, priors, earls, barons, sheriffs, reeves, ministers and all his bailiffs and faithful men inspecting the present charter. Know that we, at the prompting of God and for the health of our soul and the souls of our ancestors and successors, for the glory of holy Church and the improvement of our realm, freely and out of our good will have given and granted to the archbishops, bishops, abbots, priors, earls, barons and all of our realm these liberties written below to hold in our realm of England in perpetuity.
@ -87,35 +79,5 @@ Henry by the grace of God King of England, lord of Ireland, duke of Normandy and
All these aforesaid customs and liberties which we have granted to be held in our realm in so far as pertains to us are to be observed by all of our realm, both clergy and laity, in so far as pertains to them in respect to their own men. For this gift and grant of these liberties and of others contained in our charter over the liberties of the forest, the archbishops, bishops, abbots, priors, earls, barons, knights, fee holders and all of our realm have given us a fifteenth part of all their movable goods. Moreover we grant to them for us and our heirs that neither we nor our heirs will seek anything by which the liberties contained in this charter might be infringed or damaged, and should anything be obtained from anyone against this it is to count for nothing and to be held as nothing. With these witnesses: the lord S(tephen) archbishop of Canterbury, E(ustace) bishop of London, J(ocelin) bishop of Bath, P(eter) bishop of Winchester, H(ugh) bishop of Lincoln, R(ichard) bishop of Salisbury, W. bishop of Rochester, W(illiam) bishop of Worcester, J(ohn) bishop of Ely, H(ugh) bishop of Hereford, R(anulf) bishop of Chichester, W(illiam) bishop of Exeter, the abbot of (Bury) St Edmunds, the abbot of St Albans, the abbot of Battle, the abbot of St Augustine's Canterbury, the abbot of Evesham, the abbot of Westminster, the abbot of Peterborough, the abbot of Reading, the abbot of Abingdon, the abbot of Malmesbury, the abbot of Winchcombe, the abbot of Hyde (Winchester), the abbot of Chertsey, the abbot of Sherborne, the abbot of Cerne, the abbot of Abbotsbury, the abbot of Milton (Abbas), the abbot of Selby, the abbot of Cirencester, H(ubert) de Burgh the justiciar, H. earl of Chester and Lincoln, W(illiam) earl of Salisbury, W(illiam) earl Warenne, G. de Clare earl of Gloucester and Hertford, W(illiam) de Ferrers earl of Derby, W(illiam) de Mandeville earl of Essex, H(ugh) Bigod earl of Norfolk, W(illiam) earl Aumale, H(umphrey) earl of Hereford, J(ohn) constable of Chester, R(obert) de Ros, R(obert) fitz Walter, R(obert) de Vieuxpont, W(illiam) Brewer, R(ichard) de Montfiquet, P(eter) fitz Herbert, W(illiam) de Aubigne, G. Gresley, F. de Braose, J(ohn) of Monmouth, J(ohn) fitz Alan, H(ugh) de Mortemer, W(illiam) de Beauchamp, W(illiam) de St John, P(eter) de Maulay, Brian de Lisle, Th(omas) of Moulton, R(ichard) de Argentan, G(eoffrey) de Neville, W(illiam) Mauduit, J(ohn) de Baalon and others. Given at Westminster on the eleventh day of February in the ninth year of our reign.
We, holding these aforesaid gifts and grants to be right and welcome, conceed and confirm them for ourselves and our heirs and by the terms of the present (letters) renew them, wishing and granting for ourselves and our heirs that the aforesaid charter is to be firmly and inviably observed in all and each of its articles in perpetuity, including any articles contained in the same charter which by chance have not to date been observed. In testimony of which we have had made these our letters patent. Witnessed by Edward our son, at Westminster on the twelfth day of October in the twenty-fifth year of our reign. (Chancery warranty by John of) Stowe.
'''
partlen = 8
open('key', 'w').write('key')
hexofkey = key.encode('hex')
keyparts = []
for i in range(0, len(hexofkey), partlen):
part = hexofkey[i:i+partlen]
keyparts.append(part)
f = StringIO.StringIO()
textpartlen = len(garbage) / len(keyparts)
for i in range(len(keyparts)):
offset = i*textpartlen
if i == len(keyparts) - 1:
textpart = garbage[offset:]
else:
textpart = garbage[offset:offset+textpartlen]
fn = keyparts[i] + '.txt'
gf = gzip.GzipFile(filename=fn, mode='ab', fileobj=f)
gf.write(textpart)
gf.close()
fn = md5.new(f.getvalue()).hexdigest()
open(fn, 'wb').write(f.getvalue())
The key is "KEY".

11
puzzles/steg/30/Makefile Normal file
View File

@ -0,0 +1,11 @@
install: file.mp3
cp $< $(DESTDIR)/$$(md5sum $< | awk '{print $$1;}')
file.mp3: src.mp3 text.txt
dd if=$< bs=4 count=1 > $@
dd if=/dev/zero bs=4 count=3 >> $@
m4 KEY="$(shell cat key)" text.txt | zip - - >> $@
cat $< >> $@
clean:
rm -f file.mp3

View File

@ -1,16 +0,0 @@
#! /bin/sh -e
# Reverse:
# dd if=whatever bs=16 skip=1 | zcat
key='vegetable multitude'
echo $key > key
dd if=src.mp3 bs=4 count=1 > out.mp3
dd if=/dev/zero bs=4 count=3 >> out.mp3
(cat noise.txt; echo; echo "The key is \"$key\".") | zip - - >> out.mp3
cat src.mp3 >> out.mp3
md5=$(md5sum out.mp3 | awk '{print $1;}')
mv out.mp3 $md5

View File

@ -186,3 +186,5 @@ Article 29.
Article 30.
* Nothing in this Declaration may be interpreted as implying for any State, group or person any right to engage in any activity or to perform any act aimed at the destruction of any of the rights and freedoms set forth herein.
The key is "KEY".

16
puzzles/steg/40/Makefile Normal file
View File

@ -0,0 +1,16 @@
.DELETE_ON_ERROR:
install: file.png
cp $< $(DESTDIR)/$$(md5sum $< | awk '{print $$1;}')
%.pbm: %.png
pngtopnm $< > $@
%.png: %.pnm
pnmtopng $< > $@
file.pnm: lena.pbm text.txt
m4 -DKEY="$(shell cat key)" text.txt | ./encode 3< $< > $@
clean:
rm -f file.pnm file.png lena.pbm

34
puzzles/steg/40/encode Executable file
View File

@ -0,0 +1,34 @@
#! /usr/bin/python
import os
import sys
import md5
import cStringIO as StringIO
plaintext = sys.stdin
inf = os.fdopen(3)
outf = sys.stdout
for i in range(3):
outf.write(inf.readline())
# Set the low-order bits in output file
i = 0
while True:
c = plaintext.read(1)
if c:
c = ord(c)
else:
c = 0
img_bytes = inf.read(8)
if not img_bytes:
break
if len(img_bytes) < 8:
outf.write(img_bytes)
break
for j in range(8):
bit = 7 - j
img_byte = ord(img_bytes[j]) & 0xFE
noise_bit = (c & (1<<bit)) >> bit
out_byte = img_byte | noise_bit
outf.write(chr(out_byte))

View File

@ -1,60 +0,0 @@
#! /usr/bin/python
import os
import sys
import md5
import cStringIO as StringIO
key = 'breadfruit chawbacon'
src = os.path.dirname(sys.argv[0])
class md5file:
def __init__(self, fn='outf.bin'):
self.fn = fn
self.f = open(fn, 'wb')
self.m = md5.new()
def write(self, s):
self.f.write(s)
self.m.update(s)
def close(self):
self.f.close()
os.rename(self.fn, self.m.hexdigest())
os.system('wget -O lena.tif http://www.cs.cmu.edu/~chuck/lennapg/lena_std.tif')
inf = os.popen('tifftopnm lena.tif', 'rb')
version = inf.readline()
dimensions = inf.readline()
depth = inf.readline()
# Read in plaintext
noise = open(os.path.join(src, 'noise.txt')).read()
noise += '\n\nThe key is "%s".\n' % key
noise = StringIO.StringIO(noise)
# Set the low-order bits in output file
outf = md5file()
outf.write(version)
outf.write(dimensions)
outf.write(depth)
i = 0
while True:
c = noise.read(1)
if c:
c = ord(c)
else:
c = 0
img_bytes = inf.read(8)
if not img_bytes:
break
for j in range(8):
bit = 7 - j
img_byte = ord(img_bytes[j]) & 0xFE
noise_bit = (c & (1<<bit)) >> bit
out_byte = img_byte | noise_bit
outf.write(chr(out_byte))
outf.close()
open('key', 'w').write(key)
os.unlink('lena.tif')

BIN
puzzles/steg/40/lena.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

View File

@ -192,3 +192,4 @@
95. And thus be confident of entering into heaven rather through many tribulations, than through the assurance of peace.
The key is "KEY"

10
puzzles/steg/summary.txt Normal file
View File

@ -0,0 +1,10 @@
1: freeze a frame in an animated gif
2: unzip a .docx to find dirtbags file
3: embedded in comment in .docx
10: pngtopbm -alpha file.png
20: after JPEG footer
30: dd if=whatever bs=16 skip=1 | zcat
40: low-order bits
100: Canon.0x0018
200: filename of each gzip part