About phptuts

Author Archive | phptuts
PHP: Methods to encrypt and decrypt with private key (part 3)

PHP: Methods to encrypt and decrypt with private key (part 3)

Please read PHP: Methods to encrypt and decrypt with private key (part 1) PHP: Methods to encrypt and decrypt with private key (part 2) Method 3: use xor encryption Example usage: result: It isn’t a nice result, we need to convert to a nice result: base64_encode Result: AAAAAAAAExoFFhsXRA== unpack Result: 000000000000131a05161b1744 To decrypt, we use […]

Read full story Comments { 0 }
CURL cookie.txt file format

CURL cookie.txt file format

CURL autogenerate file cookie.txt: # Netscape HTTP Cookie File # http://curl.haxx.se/rfc/cookie_spec.html # This file was generated by libcurl! Edit at your own risk. www.filefactory.com FALSE / FALSE 0 PHPSESSID 8dcolkh52m2eo4rv61aolurjd7 .filefactory.com TRUE / FALSE 1342341229 ff_referrer_hash HDAgPzI bitshare.com FALSE / FALSE 0 PHPSESSID qjv4u6g6k20s8brar2o17msk26 bitshare.com FALSE / FALSE 1342401324 last_file_downloaded b5b7gbwq freakshare.com FALSE /files/9q5hajyh/ FALSE […]

Read full story Comments { 0 }
PHP: Methods to encrypt and decrypt with private key (part 2)

PHP: Methods to encrypt and decrypt with private key (part 2)

Please read PHP: Methods to encrypt and decrypt with private key (part 1) Method 2: use arcfour algorithm Example usage: result: It isn’t a nice result, we need to convert to a nice result: base64_encode Result: 77cOFdy5O3YaciW/Zw== unpack Result: efb70e15dcb93b761a7225bf67 To decrypt, we use this code: We get the result: your password If we encrypt […]

Read full story Comments { 0 }
PHP: Methods to encrypt and decrypt with private key (part 1)

PHP: Methods to encrypt and decrypt with private key (part 1)

There are some methods to encrypt your data with a private key. Method 1: Note: your private key must have string length greater than 8. Example usage: result: ““0bhercjya In the resulting string has special characters. We will convert the resulting string into a nice result: base64_encode Result: YGBgYDBiaGVyY2p5YQ== unpack Result: 606060603062686572636a7961 To decrypt, we […]

Read full story Comments { 0 }
PHP: Using SOCKS4 with SSL connection

PHP: Using SOCKS4 with SSL connection

Please read first: PHP SOCKS4 Interface Try to grab data from a HTTPS page like: https://www.google.com we get a empty string string(0) “” or an error 400 Bad Request: string(526) “ 400 Bad Request Bad Request Your browser sent a request that this server could not understand. Reason: You’re speaking plain HTTP to an SSL-enabled […]

Read full story Comments { 1 }
PHP SOCKS4 Interface

PHP SOCKS4 Interface

SOCKS was originally developed by David Koblas and subsequently modified and extended by me to its current running version — version 4. It is a protocol that relays TCP sessions at a firewall host to allow application users transparent access across the firewall. Because the protocol is independent of application protocols, it can be (and […]

Read full story Comments { 1 }
PHP: 4shared.com API wrapper

PHP: 4shared.com API wrapper

1. Fetch File Information There are two formats of 4shared.com’s link download: Format 1: like: http://www.4shared.com/file/253231421/73f7da19(/GoodFellas.html)? http://www.4shared.com/file/246032259/f70f9982(/_online.html)? Format 2: like: http://www.4shared.com/video/ABBPbvS8(/Divided_Heart.html)? ()? meaning yes or no step 1 using regular expression to detect format of link: with format 1, fileID is 253231421 or 246032259 with format 2, we use API’s function: decodeLink to find fileID […]

Read full story Comments { 0 }