When I was not using Angular 4, I would just put the script tags for the library. Even when I put the script tags in the index.html fi
script
index.html
Install using NPM and import below statement in you component file.
npm install crypto-js import * as crypto from 'crypto-js';
now you can use crypto in your component file.