Archive | JS

RSS feed for this section

How to create websocket secure by using NodeJS

Method 1: In this article: How to run a https website with Nodejs, express and socket.io Method 2: use NGINX file .conf Now, you can use websocket to create websocket secure: Read more: Example chat application using Nodejs + Socket.io Example chat application using Nodejs + ws Example chat application using Nodejs + Websocket

Read full story Comments { 0 }

How to run a https website with Nodejs, express and socket.io

Step 1: generate RSA key Use command line: (on Windows we can use Cygwin) Result: Step 2: create file csr.pem Result: Step 3: create SSL certificate file Result: Note: this is in practice, in production you must buy one certificate or use free SSL Step 4: continue with Nodejs app here an example app: app.js […]

Read full story Comments { 1 }

jQuery printMe2 plugin

In some case, we cant use plugin printMe to print because of popup blocker, so how to use it, i create a new version call: printMe2 Homepage : printMe http://www.daniarlandis.es/printMe/ https://github.com/menusal/printMe And here the new code We use type=iframe, so can print in the case below. Example usage:

Read full story Comments { 0 }

Flash detect by Javascript

How to detect flash by Javascript

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 { 1 }

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 { 1 }

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 { 1 }

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 { 1 }

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 { 1 }