Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node module - aes256 - crypto.createHash is not a function

So I have this Angular 5 application which uses aes256 library from NPM for encrypting password for login form. Inside that aes256 library, theres var crypto = require('crypto'). When I run my application and try the login form, I encountered crypto.createHash is not a function error. When I debugged my app to find out whats wrong, I see that var crypto was just an empty object. crypto.createHash is not a function crypto - empty object

like image 248
OpieOP Avatar asked Oct 14 '25 08:10

OpieOP


1 Answers

You cannot use crypto module in angular application nor aes256 since it is build on crypto module. crypto module is a node native module you can't use any node native module from nodejs in angular application as it is running on the browser. Checkout some fronted encryption libraries here

like image 197
Janith Avatar answered Oct 17 '25 22:10

Janith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!