des.js: remove decrypt and simplify.
The decrypt functionality is never used so remove it. Also, we can assume that we are always DES encrypting 16 characters which allows several things to be simplified in DES. Overall this removes about 80 lines of code.
This commit is contained in:
+2
-8
@@ -602,17 +602,11 @@ function send_string(str) {
|
||||
}
|
||||
|
||||
function genDES(password, challenge) {
|
||||
var i, passwd, response;
|
||||
passwd = [];
|
||||
response = challenge.slice();
|
||||
var i, passwd = [];
|
||||
for (i=0; i < password.length; i += 1) {
|
||||
passwd.push(password.charCodeAt(i));
|
||||
}
|
||||
|
||||
DES.setKeys(passwd);
|
||||
DES.encrypt(response, 0, response, 0);
|
||||
DES.encrypt(response, 8, response, 8);
|
||||
return response;
|
||||
return DES.encrypt(passwd, challenge);
|
||||
}
|
||||
|
||||
function flushClient() {
|
||||
|
||||
Reference in New Issue
Block a user