Archive | PHP

RSS feed for this section

How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Debian 8

Step 1: install nginx: Result: Step 2: Install MySQL Step 3: Install php-fpm and php5-mysql Result: Step 4: Edit file /etc/php5/fpm/php.ini Find line change to Step 5: Configure Nginx to use our PHP Example we edit file /etc/nginx/sites-available/default Done!

Read full story Comments { 0 }

PHP function chr of unicode character

PHP have function chr to find a character from a ASCII value. But PHP don’t support a function to find this with unicode character. Now, we provider some method, they are equivalent with String.fromCharCode() in Javascript: Examples:

Read full story Comments { 0 }

RC5 block cipher implement in PHP and Javascript – part 2

Read part 1: RC5 block cipher implement in PHP and Javascript Application of this block cipher method for stream cipher: There are many methods, but we can provide the method below: Split your string into many block with 64 bits (8 characters), then use this block cipher method. We can use the method Null-padding for […]

Read full story Comments { 0 }

PHP, JS: How to detect Safari browser

PHP Example: Result: Javascript

Read full story Comments { 0 }

RC5 block cipher implement in PHP and Javascript

In cryptography, RC5 is a symmetric-key block cipher notable for its simplicity. Designed by Ronald Rivest in 1994. RC5 encryption and decryption both expand the random key into 2(r+1) words that will be used sequentially (and only once each) during the encryption and decryption processes. All of the below comes from Rivest’s revised paper on […]

Read full story Comments { 0 }

XXTEA block cipher implement in PHP and Javascript

In cryptography, Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. Source: https://en.wikipedia.org/wiki/XXTEA We provide some function implement in PHP and Javascript: PHP Javascript: Example: Try it yourself Read more: TEA block cipher implement in PHP and Javascript Test vectors TEA XTEA block […]

Read full story Comments { 0 }

XTEA block cipher implement in PHP and Javascript

In cryptography, XTEA (eXtended TEA) is a block cipher designed to correct weaknesses in TEA. The cipher’s designers were David Wheeler and Roger Needham of the Cambridge Computer Laboratory, and the algorithm was presented in an unpublished technical report in 1997 (Needham and Wheeler, 1997). It is not subject to any patents.[1] Like TEA, XTEA […]

Read full story Comments { 0 }

Test vectors TEA

Read first: TEA block cipher implement in PHP and Javascript We provide some test vectors for TEA: Here is the code we use: Function strToHex

Read full story Comments { 0 }

TEA block cipher implement in PHP and Javascript

In cryptography, the Tiny Encryption Algorithm (TEA) is a block cipher notable for its simplicity of description and implementation, typically a few lines of code. It was designed by David Wheeler and Roger Needham of the Cambridge Computer Laboratory; it was first presented at the Fast Software Encryption workshop in Leuven in 1994, and first […]

Read full story Comments { 1 }

Spritz stream cipher implement in PHP and Javascript

Ron Rivest and Jacob Schuldt have proposed replacing RC4 with an improved and slightly modified version dubbed Spritz. The value w, is relatively prime to the size of the S array (256). We choose w=1. You can choose any odd value like 1,3,5,7,9… Javascript: Example: Result: Try it yourself

Read full story Comments { 0 }