About phptuts

Author Archive | phptuts
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 }