URL encrypting and verifying
Used to encrypt and verify URLs using OAuth signature encryption standards, for authentication purposes between services.
$ npm install url-encrypt --save
Creation of encryptor with secret Key
const urlEncrypt = ;const encryptor = ;
const url = encryptor;// The above result will be something like this// ...// &prfx_timestamp=15..&prfx_method=sha256&prfx_signature=...
As a result, security settings, such as an encrypted signature, will be added to the URL.
Then verifying an URL using the same configuration and the secret key
encryptor// returns true or false
Each encryption has its own expiration date after an outflow of expiration date - URL verification will turn into failure. The default expired date is 15 minutes, but it's configurable.
// Setting up expired time 1 hour;
There is a way to change the configuration after initialization:
const encryptor = ;encryptor;
All encryption options are described below.