SamDecrock / node-http-ntlm

Node.js module to authenticate using HTTP NTLM
MIT License
192 stars 89 forks source link

[Suggestion] Support md4 for ionic 3 #73

Closed davidsoendoro closed 1 year ago

davidsoendoro commented 6 years ago

Hi! I tried the httpntlm library in ionic 3 for my implementation to communicate with an IIS server with NTLM v1. At first it didn't work and I received "md4 is not supported" error. I made the workaround by using another library called 'js-md4' and replace the existing crypto with it for the md4. I think it could be interesting to add this to support applications that are developed using ionic 3 to be able to communicate with a legacy server.

Here are some code change I made locally in my place:

line 10 ntlm.js

var md4 = require('js-md4');

replace the existing md4

function create_NT_hashed_password_v1(password) {
    var buf = new Buffer(password, 'utf16le');
    // var md4 = crypto.createHash('md4');
    // md4(buf);
    return new Buffer(md4.digest(buf));
}
SamDecrock commented 1 year ago

Since version 1.8.3 I'm using js-md4, See https://github.com/SamDecrock/node-http-ntlm/commit/fcfbc48cb53863f71259e0b684b86d98210d119c

Closing ticket.