LATEST ARTICLES

RC5 block cipher implement in PHP and Javascript – part 2

rc5 stream cipher

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 the case the string length is odd. The...

PHP, JS: How to detect Safari browser

How to detect Safari browser

PHP /** * Copyright: www.tutorialspots.com **/ function isSafari($ua) { return preg_match("/^((?!chrome).)*safari/i",$ua) && stripos($ua,' version/')!==false && stripos($ua,'mqqbrowser')===false; } Example: $uas = array( 'Mozilla/5.0 (Windows NT 6.1 WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2' ,'Mozilla/5.0 (iPad CPU OS 10_1_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.79 Mobile/14B100 Safari/602.1' ,'Mozilla/5.0 (iPhone CPU...

RC5 block cipher implement in PHP and Javascript

rc5 php

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 RC5. Source: https://en.wikipedia.org/wiki/RC5 We provide some function...

XXTEA block cipher implement in PHP and Javascript

xxtea php

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 <?php /** * @author www.Tutorialspots.com * @copyright 2017 */ /** * Corrected Block TEA implement in PHP * @param $v: n word data vector * @param $key: 4 word key ...

XTEA block cipher implement in PHP and Javascript

xtea php

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. Like TEA, XTEA is a 64-bit block Feistel...

Test vectors TEA

test vectors for tea

Read first: TEA block cipher implement in PHP and Javascript We provide some test vectors for TEA: Test vector| Hex Test vector | Test key | Hex Test key |...

TEA block cipher implement in PHP and Javascript

tea php

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 published in the proceedings...

Spritz stream cipher implement in PHP and Javascript

spritz php

Ron Rivest and Jacob Schuldt have proposed replacing RC4 with an improved and slightly modified version dubbed Spritz. <?php /** * @author www.Tutorialspots.com * @copyright 2017 */ function spritz($str, $key) { //Key-scheduling algorithm (KSA) for ($s = array(), $i = 0; $i < 256; $i++) $s = $i; ...

RC4+ stream cipher implement in PHP and Javascript

rc4 plus php

RC4+ is a modified version of RC4 with a more complex three-phase key schedule (taking about 3× as long as RC4, or the same as RC4-drop512), and a more complex output function which performs four additional lookups in the S array for each byte output, taking approximately 1.7× as long as basic RC4. We provide some function of RC4+ stream...

VMPC stream cipher implement in PHP and Javascript

vmpc php

VMPC (Variably Modified Permutation Composition) is a stream cipher similar to the well known and popular cipher RC4 designed by Ron Rivest. It was designed by Bartosz Zoltak, presented in 2004 at the Fast Software Encryption conference. VMPC is a modification of the RC4 cipher. We provide some function of VMPC stream cipher implement in PHP and Javascript PHP <?php /** * @author...