Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (34 sloc) 1.321 kB
c220de6 @cweiske Crypt_Xtea-1.1.0RC1
cweiske authored
1 PHP=php
2 PHP_CMD=$(PHP) $(PHP_FLAGS)
3 SCRIPTS=tester.php XteaTest.php
dbed6d7 @cweiske RC2
cweiske authored
4 KEY=123456789
5 MSG=This is a test to test Xtea class
6 REMOTES=gw:1 indy:1
c220de6 @cweiske Crypt_Xtea-1.1.0RC1
cweiske authored
7
8 all:
9 @echo No default target...
10
11 test: test.dummy
12
13
14 test.dummy: $(SCRIPTS)
15 nice -20 $(PHP_CMD) tester.php > test.out
16
17 profile: profiled.dummy
18
19 profiled.dummy: $(SCRIPTS)
20 nice -20 $(PHP_CMD) tester.php 1 > profiled.out
dbed6d7 @cweiske RC2
cweiske authored
21
22ef8f2 @cweiske RC5
cweiske authored
22 encrypt: xteacmd.php
23 @echo -n "Give text to encrypt: "; read line; $(PHP_CMD) xteacmd.php -e $(KEY) "$$line"; echo
dbed6d7 @cweiske RC2
cweiske authored
24
22ef8f2 @cweiske RC5
cweiske authored
25 decrypt: xteacmd.php
26 @echo -n "Give text to decrypt: "; read line; $(PHP_CMD) xteacmd.php -d $(KEY) "$$line"; echo
dbed6d7 @cweiske RC2
cweiske authored
27
22ef8f2 @cweiske RC5
cweiske authored
28 simple: xteacmd.php
29 enc=`$(PHP_CMD) xteacmd.php -e $(KEY) "$(MSG)"`; echo encrypted="$$enc"; \
30 dec=`$(PHP_CMD) xteacmd.php -d $(KEY) "$$enc"`; echo "decrypted=$$dec"
dbed6d7 @cweiske RC2
cweiske authored
31
32 full:
33 $(PHP_CMD) full.php > x
34 for i in $(REMOTES); do \
35 echo "doing '$$i' ... "; \
36 scp full.php $$i && \
37 export host=`echo $$i | cut -d: -f 1` && \
38 export path=`echo $$i | cut -d: -f 2-` && \
39 echo "ssh $$host \"cd $$path && $(PHP_CMD) full.php > x\"" && \
40 ssh $$host "cd $$path && $(PHP_CMD) full.php > x" && \
41 echo scp $$i/x x.$$host && \
42 scp $$i/x x.$$host && \
43 if diff x x.$$host > /dev/null; then echo $$host ok; else echo different output from $$host; fi; \
44 done
Something went wrong with that request. Please try again.