cvs: presentations /slides/encryption mcrypt-bug26733.xml phptropics.css puzzle2.xml resources.xml store-data-in-db-ex-retrieve.xml
store-data-in-db-ex-store.xml tropics.png

From: Date: Tue, 26 Apr 2005 14:22:38 +0000
Subject: cvs: presentations /slides/encryption mcrypt-bug26733.xml phptropics.css puzzle2.xml resources.xml store-data-in-db-ex-retrieve.xml
store-data-in-db-ex-store.xml tropics.png
Groups: php.pres 
Request: Send a blank email to pres+get-1118@lists.php.net to get a copy of this message
derick Tue Apr 26 10:22:38 2005 EDT Added files: /presentations/slides/encryption phptropics.css puzzle2.xml tropics.png Modified files: /presentations/slides/encryption mcrypt-bug26733.xml resources.xml store-data-in-db-ex-retrieve.xml store-data-in-db-ex-store.xml Log: - Added php|tropics and a'dam mcrypt talks.

http://cvs.php.net/diff.php/presentations/slides/encryption/mcrypt-bug26733.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/encryption/mcrypt-bug26733.xml diff -u presentations/slides/encryption/mcrypt-bug26733.xml:1.1 presentations/slides/encryption/mcrypt-bug26733.xml:1.2 --- presentations/slides/encryption/mcrypt-bug26733.xml:1.1 Wed Jan 21 01:42:42 2004 +++ presentations/slides/encryption/mcrypt-bug26733.xml Tue Apr 26 10:22:37 2005 @@ -2,7 +2,6 @@ <slide> <title>Q2: Bug #26733</title> - <break lines="2"/> <blurb fontsize="3em">"I have a string encrypted with mcrypt and encoded in base64. I unbase64 this string and I decrypt it using mcrypt. I looks like I got the exact same string but when I compare it with == it is not the same."</blurb> @@ -21,7 +20,6 @@ $text = mdecrypt_generic($td, $crypt_text); echo $text; ?>]]></example> - <break /> <list fontsize="4em" effect="slide" marginleft="-2em"> <bullet>If you use a block method, mcrypt will pad with \0s.</bullet> <bullet>So store the original length of the text too.</bullet> http://cvs.php.net/diff.php/presentations/slides/encryption/resources.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/encryption/resources.xml diff -u presentations/slides/encryption/resources.xml:1.2 presentations/slides/encryption/resources.xml:1.3 --- presentations/slides/encryption/resources.xml:1.2 Wed Jan 21 01:42:42 2004 +++ presentations/slides/encryption/resources.xml Tue Apr 26 10:22:37 2005 @@ -6,9 +6,8 @@ <image align="center" filename="blowfish.png" /> <break lines="2" /> - <link fontsize="3em" marginleft="2em" leader="These Slides: " href="http://pres.derickrethans.nl/mcrypt-vancouver" target="_new"/> + <link fontsize="3em" marginleft="2em" leader="These Slides: " href="http://derickrethans.nl/talks.php" target="_new"/> <link fontsize="3em" marginleft="2em" leader="PHP: " href="http://www.php.net" target="_new"/> - <link fontsize="3em" marginleft="2em" leader="Crypto Intro: " href="http://" target="_new"/> - <link fontsize="3em" marginleft="2em" leader="Questions?: " href="mailto:derick@php.net" target="_new"/> + <link fontsize="3em" marginleft="2em" leader="Questions?: " href="mailto:dr@ez.no" target="_new"/> </slide> http://cvs.php.net/diff.php/presentations/slides/encryption/store-data-in-db-ex-retrieve.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/encryption/store-data-in-db-ex-retrieve.xml diff -u presentations/slides/encryption/store-data-in-db-ex-retrieve.xml:1.1 presentations/slides/encryption/store-data-in-db-ex-retrieve.xml:1.2 --- presentations/slides/encryption/store-data-in-db-ex-retrieve.xml:1.1 Wed Mar 23 07:36:10 2005 +++ presentations/slides/encryption/store-data-in-db-ex-retrieve.xml Tue Apr 26 10:22:37 2005 @@ -18,7 +18,14 @@ mysql_select_db('encryption'); $username = $_POST['username']; -$password = sha1($_POST['password']); +$password = sha1('SECRET' . $_POST['password']); + +/* Init mcrypt environment */ +$td = @mcrypt_module_open('rijndael-256', '', 'cfb', ''); +$iv_size = mcrypt_enc_get_iv_size($td); +$key_size = mcrypt_enc_get_key_size($td); +$key = $iv = substr(sha1($_POST['password']), 0, $key_size); +mcrypt_generic_init($td, $key, $iv); /* Retrieve data */ $q = <<<END @@ -31,13 +38,6 @@ list($id, $username, $password, $adres, $ccnr) = mysql_fetch_row($res); - /* Init mcrypt environment */ - $td = @mcrypt_module_open('rijndael-256', '', 'cfb', ''); - $iv_size = mcrypt_enc_get_iv_size($td); - $key_size = mcrypt_enc_get_key_size($td); - $key = $iv = substr($password, 0, $key_size); - mcrypt_generic_init($td, $key, $iv); - /* Decrypt data */ echo "Retrieved data:<br/>\n"; echo "Address: ", http://cvs.php.net/diff.php/presentations/slides/encryption/store-data-in-db-ex-store.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/encryption/store-data-in-db-ex-store.xml diff -u presentations/slides/encryption/store-data-in-db-ex-store.xml:1.1 presentations/slides/encryption/store-data-in-db-ex-store.xml:1.2 --- presentations/slides/encryption/store-data-in-db-ex-store.xml:1.1 Wed Mar 23 07:36:10 2005 +++ presentations/slides/encryption/store-data-in-db-ex-store.xml Tue Apr 26 10:22:37 2005 @@ -25,8 +25,8 @@ /* Prepare data to insert */ $username = $_POST['username']; -$password = sha1($_POST['password']); -$key = $iv = substr($password, 0, $key_size); +$password = sha1('SECRET' . $_POST['password']); +$key = $iv = substr(sha1($_POST['password']), 0, $key_size); mcrypt_generic_init($td, $key, $iv); $adres = base64_encode(mcrypt_generic($td, $_POST['adres'])); http://cvs.php.net/co.php/presentations/slides/encryption/phptropics.css?r=1.1&p=1 Index: presentations/slides/encryption/phptropics.css +++ presentations/slides/encryption/phptropics.css <style title="Default" type="text/css"> body { font-size: 10pt; margin-left:290px; margin-right:0em; margin-bottom:0em; background-image: url(presentations/slides/encryption/tropics.png); background-attachment: fixed; overflow: -moz-scrollbars-none; } div.sticky { margin: 0; position: fixed; top: 0em; left: 290px; right: auto; bottom: auto; } div.navbar { padding: 4; margin: 0; height: 14em; font-family: verdana, tahoma, arial, helvetica, sans-serif; z-index: 99; } div.navbar_title, div.navbar_title a, div.subtitle { font-size: 32px; color: #039; text-decoration: none; text-align: left; font-weight: bold; margin-top: 20px; } div.subtitle { margin-top: 5px; font-size: 24; font-weight: normal; font-style: italic; } div.navbar_nr a { font-size: 16px; color: #77a; text-decoration: none; position: fixed; right: 10px; bottom: 0px; } div.mainarea { margin-top: 120px; top: 150px; width: 733px; height: 600px; overflow: auto; overflow: -moz-scrollbars-vertical; } ul.pres { list-style: circle; font-size: 24pt; } ul.level2 { list-style: circle; font-size: 20pt; margin-left: 40px; margin-top: -15px; } li.pres_bullet { font-size: 28pt; margin-right: 40px; } li.pres_bullet_nr { font-size: 28pt; margin-right: 40px; list-style-type: decimal; } ul.large div li.pres_bullet { font-size: 40pt; } ul.small div li.pres_bullet { font-size: 20pt; } div.title_blurb { font-size: 80px; text-align: center; font-weight: bold; } div.small_blurb { font-size: 24px; } div.blurb, div.bit_larger_output_text { font-size: 28pt; width: 100%; } div.bit_larger_output_text { margin-top: 10px; } div.x_small_blurb { font-size: 0.5em; } div.large_blurb { font-size: 32pt; } div.large_blurb_center { font-size: 48px; text-align: center; } div.quote { font-size: 48px; text-align: center; margin-left: 40px; margin-right: 40px; } div.quote_attr { font-size: 32px; text-align: right; margin-right: 40px; } div.xx_large_blurb_center { font-size: 80px; text-align: center; } div.q_mark { text-align: center; font-size: 480px; } div.shadow, code { font-size: 18px; width: 640px; } div.example code, div.highlight code, div.bit_larger, div.bit_larger code, div.bit_larger_output { background: #eee; font-size: 23px; width: 100%; } div.example, div.highlight, div.bit_larger, div.bit_larger_output { margin-left: 20px; margin-right: 20px; } div.large code, div.large { font-size: 32px; background: #eee; font-weight: bold; margin-left: 20px; margin-right: 20px; } div.highlight code, div.highlight { background: #fffc00; font-weight: bold; } div.code_small, div.code_medium, div.code_large, div.example { background: #eee; } div.code_small code { font-size: 12px; } div.code_medium code, div.code_medium pre { font-size: 20px; } div.code_large code, div.code_large pre { font-size: 24px; } div.example pre { font-size: 23px; } div.event, div.event-date, div.event-presenter { text-align: center; font-size: 32pt; } div.pres-url-small { text-align: center; font-size: 24pt; } img.spaced { margin-right: 25px; margin-left: 25px; margin-top: 25px; margin-bottom: 25px; } table { font-size: 20pt; } </style> http://cvs.php.net/co.php/presentations/slides/encryption/puzzle2.xml?r=1.1&p=1 Index: presentations/slides/encryption/puzzle2.xml +++ presentations/slides/encryption/puzzle2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Puzzle</title> <blurb> jaahprviiembsgrayhhfnhpfocieomegrran ceeaeewmnqbqeauyuwdaaaeatdtmnleeesow </blurb> </slide>
« previous php.pres (#1118) next »