Skip to content

Crypto support

salvador-mylife edited this page Aug 20, 2021 · 2 revisions

Crypto Support for MyLife.com APIs

Currently MyLife.com APIs support AES-256-CBC with PKCS padding


Examples

Javascript

The JS/HTML sample uses a crypto-js library (found here) everything else needed is contained within the HTML file.

Steps to use

  1. Download the HTML crypto test page here
  2. Download crypto-js library to you computer using bower bower install crypto-js or directly from GitHub
  3. Open cryptoJsTest.html on a text editor and change <path_to_cryptojs>/crypto-js/ to the actual location of the crypto-js library from step 2
  4. Open cryptoJsTest.html on a text editor and change 1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF for your actual secret key, save the changes
  5. Open cryptoJsTest.html on a web browser
  6. Type the first name, last name, location in clear text
  7. Type the hexadecimal version of IV or click Generate IV button
  8. Click Encrypt button

If you are using the encrypted values generated by this sample to call MylIfe.com APIs please make sure to properly URL encode them and pass the Hex IV as the inve parameter on the API

Clone this wiki locally