Skip to main content

Tedshd's Dev note

JavaScript - Encryption

Table of Contents

# JavaScript - Encryption

弱弱的加密

## base64

Base64 encoding and decoding

## sha1(only js to js)

Need utf8 encode JavaScript sha1 function

## utf8(only js to js)

JavaScript utf8_encode function JavaScript utf8_decode function decode can handle php utf8_encode()

## Encrypt(js to php)

Use crypto-js

HMAC

Refer - Javascript: Equivalent of PHP’s hash_hmac() with RAW BINARY output?