Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 29th, 2006, 9:34 AM   #1
Godmode
Newbie
 
Join Date: Jun 2005
Posts: 13
Rep Power: 0 Godmode is on a distinguished road
Question Why does not this work? (php,mcrypt)

<?php
$key="key";
function en($text) { //
$ivk = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($ivk, MCRYPT_RAND);
$kryp = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $text, "ecb", $iv);
echo $kryp;
} //
echo en("asdasd"); //
?>

This returns empty! WTF is wrong ?! Works if Ill remove lines where // at the end :eek:
Godmode is offline   Reply With Quote
Old Jan 29th, 2006, 9:38 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Please read the forum's rules/FAQ and a "How to Post...." thread. These are HTML pages: they eat whitespace. The use of code tags will preserve your formatting and make your code easier to read for those desiring to offer help. Aside from that, you don't indicate what your criterion for works/not works is.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC