LATEST ARTICLES

How to install netstat on Linux

install netstat linux

To install netstat on Linux, use one command line yum install net-tools Result: # yum install net-tools Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.xmission.com * epel: mirrors.kernel.org * extras: mirrors.xmission.com * remi: mirrors.thzhost.com * remi-php56: mirrors.thzhost.com * remi-safe: mirrors.thzhost.com * updates: mirrors.xmission.com Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package ...

PHP function chr of unicode character

chr unicode

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: /** * @author www.Tutorialspots.com * @copyright 2017 */ function unichr($dec) { if ($dec < 128) { $utf = chr($dec); } elseif ($dec < 2048){ ...

How to install OpenVPN on Linux

You can easily install OpenVPN on Debian, Ubuntu and CentOS by using only one command line: wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh Result: # wget https://git.io/vpn -O openvpn-install. sh && bash openvpn-install.sh --2017-02-27 03:37:01-- https://git.io/vpn Resolving git.io (git.io)... 54.243.154.49, 54.235.212.238, 75.101.145.225, ... Connecting to git.io (git.io)|54.243.154.49|:443... connected. HTTP request sent, awaiting response... 302 Found Welcome to this quick OpenVPN "road warrior" installer I need to ask you...

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...