Date: 03/06/00
- Next message: ghost <email protected>: "[PHP-DEV] Bug #3742: PHP upload + MySQL insert fails for anything more than 1 meg"
- Previous message: Bug Database: "[PHP-DEV] Bug #2587 Updated: maybe.. exec function has some problem"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] ADDON: Internal encoding functions"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] ADDON: Internal encoding functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
Firstly Andi and Andrei,
Andi>I don't think convert_to_string_ex() can fail converting to a string.
So
Andi>you don't need that check.
My patch>+ convert_to_string_ex(str);
My patch>+
My patch>+ if ((*str)->type != IS_STRING) {
My patch>+ RETURN_FALSE;
My patch>+ }
Andrei removed those lines....
That check is also present in getenv(), and since I am new, I consulted
to neighbour functions! (I have removed this check from getenv it in this
patch).
Patch can be applied on PHP4b4-PL1 fresh copy! Tested under RH6.
I have made a COOOOL internal encryption!
NEW FUNCTIONS:
* encode()
* decode()
* encdec()
Example: (encdec.php, attached too!)
<?
// encdec
$x = encdec ( "faisal" , "f13" );
print "Return: $x, Length: " . strlen ( $x );
print "\n";
$y = encdec ( $x , "13" );
print "Decoded: $y, Length: " . strlen ( $y );
print "\n\n";
// encode
$enc = encode ( "faisal" , "cool" );
print "Encoded: $enc\n";
$dec = decode ( $enc , "cool" );
print "Decoded: $dec\n";
?>
encode() encrypts then apply the php_base64_encode() on it...
decode() applies php_base64_decode() and then decrypts it...
encdec() does not involve any calling to base*() function....
Its pretty stable and secure as far as I think!
But there is just one problem which I am stuck!
When you call decode, it prints:
base64.c(91) : Freeing 0x08113CCC (9 bytes), script=encdec.php
I really don't understand why its doing that... perhaps some
back in the decoder....
I don't have access to CVS, so either of you (or somebody) else
may apply the patches!
This is some more of my contribution to PHP!
Enjoy!
Faisal
the Whiz Kid.
- application/octet-stream attachment: basic_functions.h.patch.2
- application/octet-stream attachment: basic_functions.c.patch.2
- application/octet-stream attachment: mycrypt.h
- application/octet-stream attachment: encdec.php
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: ghost <email protected>: "[PHP-DEV] Bug #3742: PHP upload + MySQL insert fails for anything more than 1 meg"
- Previous message: Bug Database: "[PHP-DEV] Bug #2587 Updated: maybe.. exec function has some problem"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] ADDON: Internal encoding functions"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] ADDON: Internal encoding functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

