Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypo

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypo - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

lib/DecodeToHex.js

67

dist/Crypo.js

@@ -54,4 +54,4 @@ var Crypo =

var Encode = __webpack_require__(5);
var Decode = __webpack_require__(4);
var Encode = __webpack_require__(6);
var Decode = __webpack_require__(5);

@@ -70,4 +70,4 @@ var Methods = {

*/
AER256: __webpack_require__(2),
ARMON64: __webpack_require__(3)
AER256: __webpack_require__(3),
ARMON64: __webpack_require__(4)
};

@@ -80,2 +80,4 @@

return str;
} else if (typeof Methods[method] === 'object') {
return Methods[method].encode(str, arguments[2]);
}

@@ -91,2 +93,4 @@

return str;
} else if (typeof Methods[method] === 'object') {
return Methods[method].decode(str, arguments[2]);
}

@@ -97,2 +101,4 @@

console.log(exports.decode('AER256', '278, 278, 22', 'aaey'));
exports.getSupportedMethods = function () {

@@ -202,6 +208,6 @@ return Object.keys(Methods);

/* 2 */
/***/ function(module, exports, __webpack_require__) {
/***/ function(module, exports) {
/**
* @providesModule AER256
* @providesModule decodeToHex
*/

@@ -211,5 +217,3 @@

var completeEscape = __webpack_require__(1);
function decToHex(oNum) {
module.exports = function (oNum) {
var hexChars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'),

@@ -228,4 +232,17 @@ outP = '',

return outP;
}
};
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* @providesModule AER256
*/
'use strict';
var completeEscape = __webpack_require__(1);
var decodeToHex = __webpack_require__(2);
exports.encode = function (oString, oKey) {

@@ -248,9 +265,13 @@ if (oKey.length < 3) {

var theNum = parseInt('0x' + completeEscape(oString.substr(x, Math.round(oKey.length / 2))));
if (isNaN(theNum)) {
window.alert('Encryption Failed!');
console.log('Encryption Failed!');
return oString;
}
for (var z = 0; z < oKey.length; z++) {
eval('theNum ' + oOp[z % 3] + ' ' + oKeyNum[z] + ';');
}
oOutStr += y + theNum;

@@ -283,3 +304,3 @@ }

}
oOutStr[x] = decToHex(Math.round(oOutStr[x]));
oOutStr[x] = decodeToHex(Math.round(oOutStr[x]));
}

@@ -296,3 +317,3 @@

/***/ },
/* 3 */
/* 4 */
/***/ function(module, exports, __webpack_require__) {

@@ -307,16 +328,4 @@

var completeEscape = __webpack_require__(1);
var decodeToHex = __webpack_require__(2);
function decToHex(oNum) {
var hexChars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'),
outP = '',
d;
for (var x = oNum; x > 0; x = (x - x % 16) / 16) {
outP = hexChars[x % 16] + '' + outP;
}
if (outP.length % 2) {
outP = '0' + outP;
}
return outP;
}
exports.encode = function (oString, oKey) {

@@ -379,3 +388,3 @@ if (oKey.length < 3) {

oOutStr[x] = decToHex(Math.round(oOutStr[x]));
oOutStr[x] = decodeToHex(Math.round(oOutStr[x]));
}

@@ -392,3 +401,3 @@

/***/ },
/* 4 */
/* 5 */
/***/ function(module, exports) {

@@ -446,3 +455,3 @@

/***/ },
/* 5 */
/* 6 */
/***/ function(module, exports) {

@@ -449,0 +458,0 @@

@@ -1,1 +0,1 @@

var Crypo=function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var o=r(5),n=r(4),u={A128:"/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC",MEGAN35:"3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5",GILA7:"7ZSTJK+W=cVtBCasyf0gzA8uvwDEq3XH/1RMNOILPQU4klm65YbdeFrx2hij9nopG",TRIPO5:"ghijopE+G78lmnIJQRXY=abcS/UVWdefABCs456tDqruvNOPwx2KLyz01M3Hk9ZFT",AER256:r(2),ARMON64:r(3)};e.encode=function(t,e){return u[t]?o(u[t],e):(console.log(t+" is currently not supported."),e)},e.decode=function(t,e){return u[t]?n(u[t],e):(console.log(t+" is currently not supported."),e)},e.getSupportedMethods=function(){return Object.keys(u)},e.addMethod=function(t,e){return u[t]=e}},function(t,e){"use strict";t.exports=function(t){var e,r=new Array,o=new Array;for(e=0;e<t.length;e++)r[e]=t.charAt(e);for(o.a="61",o.b="62",o.c="63",o.d="64",o.e="65",o.f="66",o.g="67",o.h="68",o.i="69",o.j="6A",o.k="6B",o.l="6C",o.m="6D",o.n="6E",o.o="6F",o.p="70",o.q="71",o.r="72",o.s="73",o.t="74",o.u="75",o.v="76",o.w="77",o.x="78",o.y="79",o.z="7A",o.A="41",o.B="42",o.C="43",o.D="44",o.E="45",o.F="46",o.G="47",o.H="48",o.I="49",o.J="4A",o.K="4B",o.L="4C",o.M="4D",o.N="4E",o.O="4F",o.P="50",o.Q="51",o.R="52",o.S="53",o.T="54",o.U="55",o.V="56",o.W="57",o.X="58",o.Y="59",o.Z="5A",o[0]="30",o[1]="31",o[2]="32",o[3]="33",o[4]="34",o[5]="35",o[6]="36",o[7]="37",o[8]="38",o[9]="39",o["*"]="2A",o["/"]="2F",o._="5F",o["+"]="2B",o["-"]="2D",o["@"]="40",o["."]="2E",e=0;e<r.length;e++)r[e]=r[e]==escape(r[e])?o[r[e]]:escape(r[e]).replace(/%/,"");return r.join("")}},function(module,exports,__webpack_require__){"use strict";function decToHex(t){var e,r=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),o="";for(e=t;e>0;e=(e-e%16)/16)o=r[e%16]+""+o;return o.length%2&&(o="0"+o),o}var completeEscape=__webpack_require__(1);exports.encode=function(oString,oKey){var oKeyNum,oOutStr,oOp,x,y,theNum,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr="",oOp=new Array("+=","/=","-=","*= 0.02 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0,y="";x<oString.length;x+=Math.round(oKey.length/2),y=", "){if(theNum=parseInt("0x"+completeEscape(oString.substr(x,Math.round(oKey.length/2)))),isNaN(theNum))return window.alert("Encryption Failed!"),oString;for(z=0;z<oKey.length;z++)eval("theNum "+oOp[z%3]+" "+oKeyNum[z]+";");oOutStr+=y+theNum}return oOutStr},exports.decode=function(oString,oKey){var oKeyNum,oOutStr,oOutStr2,oOp,x,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr=oString.split(", "),oOutStr2="",oOp=new Array("-=","*=","+=","/= 0.02 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0;x<oOutStr.length;x++){for(oOutStr[x]=parseFloat(oOutStr[x]),z=oKey.length-1;z>=0;z--)eval("oOutStr[x] "+oOp[z%3]+" "+oKeyNum[z]+";");oOutStr[x]=decToHex(Math.round(oOutStr[x]))}for(oOutStr=oOutStr.join(""),x=0;x<oOutStr.length;x+=2)oOutStr2+=unescape("%"+oOutStr.substr(x,2));return oOutStr2}},function(module,exports,__webpack_require__){"use strict";function decToHex(t){var e,r=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),o="";for(e=t;e>0;e=(e-e%16)/16)o=r[e%16]+""+o;return o.length%2&&(o="0"+o),o}var completeEscape=__webpack_require__(1);exports.encode=function(oString,oKey){var oKeyNum,oOutStr,oOp,x,y,theNum,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr="",oOp=new Array("+=","/=","-=","*= 0.01 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0,y="";x<oString.length;x+=Math.round(oKey.length/2),y="+"){if(theNum=parseInt("0x"+completeEscape(oString.substr(x,Math.round(oKey.length/2)))),isNaN(theNum))return console.log("Encryption failed!"),oString;for(z=0;z<oKey.length;z++)eval("theNum "+oOp[z%4]+" "+oKeyNum[z]+";");oOutStr+=y+theNum}return oOutStr},exports.decode=function(oString,oKey){var oKeyNum,oOutStr,oOutStr2,oOp,x,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr=oString.split("+"),oOutStr2="",oOp=new Array("-=","*=","+=","/= 0.01 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0;x<oOutStr.length;x++){for(oOutStr[x]=parseFloat(oOutStr[x]),z=oKey.length-1;z>=0;z--)eval("oOutStr[x] "+oOp[z%4]+" "+oKeyNum[z]+";");oOutStr[x]=decToHex(Math.round(oOutStr[x]))}for(oOutStr=oOutStr.join(""),x=0;x<oOutStr.length;x+=2)oOutStr2+=unescape("%"+oOutStr.substr(x,2));return oOutStr2}},function(t,e){"use strict";t.exports=function(t,e){var r,o,n,u,a,c="",s="",x="",i=0,l=/[^A-Za-z0-9\+\/\=]/g;l.exec(e)&&alert("Errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do n=t.indexOf(e.charAt(i++)),u=t.indexOf(e.charAt(i++)),a=t.indexOf(e.charAt(i++)),x=t.indexOf(e.charAt(i++)),r=n<<2|u>>4,o=(15&u)<<4|a>>2,s=(3&a)<<6|x,c+=String.fromCharCode(r),64!=a&&(c+=String.fromCharCode(o)),64!=x&&(c+=String.fromCharCode(s)),r=o=s="",n=u=a=x="";while(i<e.length);return unescape(c)}},function(t,e){"use strict";t.exports=function(t,e){var r,o,n,u,a,c,s,x,i;e=escape(e),r="",u="",x="",i=0;do o=e.charCodeAt(i++),n=e.charCodeAt(i++),u=e.charCodeAt(i++),a=o>>2,c=(3&o)<<4|n>>4,s=(15&n)<<2|u>>6,x=63&u,isNaN(n)?s=x=64:isNaN(u)&&(x=64),r=r+t.charAt(a)+t.charAt(c)+t.charAt(s)+t.charAt(x),o=n=u="",a=c=s=x="";while(i<e.length);return r}}]);
var Crypo=function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";var r=o(6),n=o(5),u={A128:"/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC",MEGAN35:"3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5",GILA7:"7ZSTJK+W=cVtBCasyf0gzA8uvwDEq3XH/1RMNOILPQU4klm65YbdeFrx2hij9nopG",TRIPO5:"ghijopE+G78lmnIJQRXY=abcS/UVWdefABCs456tDqruvNOPwx2KLyz01M3Hk9ZFT",AER256:o(3),ARMON64:o(4)};t.encode=function(e,t){return u[e]?"object"==typeof u[e]?u[e].encode(t,arguments[2]):r(u[e],t):(console.log(e+" is currently not supported."),t)},t.decode=function(e,t){return u[e]?"object"==typeof u[e]?u[e].decode(t,arguments[2]):n(u[e],t):(console.log(e+" is currently not supported."),t)},console.log(t.decode("AER256","278, 278, 22","aaey")),t.getSupportedMethods=function(){return Object.keys(u)},t.addMethod=function(e,t){return u[e]=t}},function(e,t){"use strict";e.exports=function(e){var t,o=new Array,r=new Array;for(t=0;t<e.length;t++)o[t]=e.charAt(t);for(r.a="61",r.b="62",r.c="63",r.d="64",r.e="65",r.f="66",r.g="67",r.h="68",r.i="69",r.j="6A",r.k="6B",r.l="6C",r.m="6D",r.n="6E",r.o="6F",r.p="70",r.q="71",r.r="72",r.s="73",r.t="74",r.u="75",r.v="76",r.w="77",r.x="78",r.y="79",r.z="7A",r.A="41",r.B="42",r.C="43",r.D="44",r.E="45",r.F="46",r.G="47",r.H="48",r.I="49",r.J="4A",r.K="4B",r.L="4C",r.M="4D",r.N="4E",r.O="4F",r.P="50",r.Q="51",r.R="52",r.S="53",r.T="54",r.U="55",r.V="56",r.W="57",r.X="58",r.Y="59",r.Z="5A",r[0]="30",r[1]="31",r[2]="32",r[3]="33",r[4]="34",r[5]="35",r[6]="36",r[7]="37",r[8]="38",r[9]="39",r["*"]="2A",r["/"]="2F",r._="5F",r["+"]="2B",r["-"]="2D",r["@"]="40",r["."]="2E",t=0;t<o.length;t++)o[t]=o[t]==escape(o[t])?r[o[t]]:escape(o[t]).replace(/%/,"");return o.join("")}},function(e,t){"use strict";e.exports=function(e){var t,o=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),r="";for(t=e;t>0;t=(t-t%16)/16)r=o[t%16]+""+r;return r.length%2&&(r="0"+r),r}},function(module,exports,__webpack_require__){"use strict";var completeEscape=__webpack_require__(1),decodeToHex=__webpack_require__(2);exports.encode=function(oString,oKey){var oKeyNum,oOutStr,oOp,x,y,theNum,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr="",oOp=new Array("+=","/=","-=","*= 0.02 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0,y="";x<oString.length;x+=Math.round(oKey.length/2),y=", "){if(theNum=parseInt("0x"+completeEscape(oString.substr(x,Math.round(oKey.length/2)))),isNaN(theNum))return console.log("Encryption Failed!"),oString;for(z=0;z<oKey.length;z++)eval("theNum "+oOp[z%3]+" "+oKeyNum[z]+";");oOutStr+=y+theNum}return oOutStr},exports.decode=function(oString,oKey){var oKeyNum,oOutStr,oOutStr2,oOp,x,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr=oString.split(", "),oOutStr2="",oOp=new Array("-=","*=","+=","/= 0.02 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0;x<oOutStr.length;x++){for(oOutStr[x]=parseFloat(oOutStr[x]),z=oKey.length-1;z>=0;z--)eval("oOutStr[x] "+oOp[z%3]+" "+oKeyNum[z]+";");oOutStr[x]=decodeToHex(Math.round(oOutStr[x]))}for(oOutStr=oOutStr.join(""),x=0;x<oOutStr.length;x+=2)oOutStr2+=unescape("%"+oOutStr.substr(x,2));return oOutStr2}},function(module,exports,__webpack_require__){"use strict";var completeEscape=__webpack_require__(1),decodeToHex=__webpack_require__(2);exports.encode=function(oString,oKey){var oKeyNum,oOutStr,oOp,x,y,theNum,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr="",oOp=new Array("+=","/=","-=","*= 0.01 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0,y="";x<oString.length;x+=Math.round(oKey.length/2),y="+"){if(theNum=parseInt("0x"+completeEscape(oString.substr(x,Math.round(oKey.length/2)))),isNaN(theNum))return console.log("Encryption failed!"),oString;for(z=0;z<oKey.length;z++)eval("theNum "+oOp[z%4]+" "+oKeyNum[z]+";");oOutStr+=y+theNum}return oOutStr},exports.decode=function(oString,oKey){var oKeyNum,oOutStr,oOutStr2,oOp,x,z;if(oKey.length<3)return console.log("The key must be at least 3 characters long"),oString;for(oKeyNum=new Array,oOutStr=oString.split("+"),oOutStr2="",oOp=new Array("-=","*=","+=","/= 0.01 *"),x=0;x<oKey.length;x++)oKeyNum[x]=parseInt("0x"+completeEscape(oKey.charAt(x)));for(x=0;x<oOutStr.length;x++){for(oOutStr[x]=parseFloat(oOutStr[x]),z=oKey.length-1;z>=0;z--)eval("oOutStr[x] "+oOp[z%4]+" "+oKeyNum[z]+";");oOutStr[x]=decodeToHex(Math.round(oOutStr[x]))}for(oOutStr=oOutStr.join(""),x=0;x<oOutStr.length;x+=2)oOutStr2+=unescape("%"+oOutStr.substr(x,2));return oOutStr2}},function(e,t){"use strict";e.exports=function(e,t){var o,r,n,u,a,c="",s="",x="",i=0,l=/[^A-Za-z0-9\+\/\=]/g;l.exec(t)&&alert("Errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do n=e.indexOf(t.charAt(i++)),u=e.indexOf(t.charAt(i++)),a=e.indexOf(t.charAt(i++)),x=e.indexOf(t.charAt(i++)),o=n<<2|u>>4,r=(15&u)<<4|a>>2,s=(3&a)<<6|x,c+=String.fromCharCode(o),64!=a&&(c+=String.fromCharCode(r)),64!=x&&(c+=String.fromCharCode(s)),o=r=s="",n=u=a=x="";while(i<t.length);return unescape(c)}},function(e,t){"use strict";e.exports=function(e,t){var o,r,n,u,a,c,s,x,i;t=escape(t),o="",u="",x="",i=0;do r=t.charCodeAt(i++),n=t.charCodeAt(i++),u=t.charCodeAt(i++),a=r>>2,c=(3&r)<<4|n>>4,s=(15&n)<<2|u>>6,x=63&u,isNaN(n)?s=x=64:isNaN(u)&&(x=64),o=o+e.charAt(a)+e.charAt(c)+e.charAt(s)+e.charAt(x),r=n=u="",a=c=s=x="";while(i<t.length);return o}}]);

@@ -8,19 +8,4 @@ /**

var completeEscape = require('./completeEscape');
var decodeToHex = require('./decodeToHex');
function decToHex(oNum) {
var hexChars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'),
outP = '',
d;
for (var x = oNum; x > 0; x = (x - x % 16) / 16) {
outP = hexChars[x % 16] + '' + outP;
}
if (outP.length % 2) {
outP = '0' + outP;
}
return outP;
}
exports.encode = function (oString, oKey) {

@@ -43,9 +28,13 @@ if (oKey.length < 3) {

var theNum = parseInt('0x' + completeEscape(oString.substr(x, Math.round(oKey.length / 2))));
if (isNaN(theNum)) {
window.alert('Encryption Failed!');
console.log('Encryption Failed!');
return oString;
}
for (var z = 0; z < oKey.length; z++) {
eval('theNum ' + oOp[z % 3] + ' ' + oKeyNum[z] + ';');
}
oOutStr += y + theNum;

@@ -78,3 +67,3 @@ }

}
oOutStr[x] = decToHex(Math.round(oOutStr[x]));
oOutStr[x] = decodeToHex(Math.round(oOutStr[x]));
}

@@ -81,0 +70,0 @@

@@ -8,16 +8,4 @@ /**

var completeEscape = require('./completeEscape');
var decodeToHex = require('./decodeToHex');
function decToHex(oNum) {
var hexChars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'),
outP = '',
d;
for (var x = oNum; x > 0; x = (x - x % 16) / 16) {
outP = hexChars[x % 16] + '' + outP;
}
if (outP.length % 2) {
outP = '0' + outP;
}
return outP;
}
exports.encode = function (oString, oKey) {

@@ -80,3 +68,3 @@ if (oKey.length < 3) {

oOutStr[x] = decToHex(Math.round(oOutStr[x]));
oOutStr[x] = decodeToHex(Math.round(oOutStr[x]));
}

@@ -83,0 +71,0 @@

@@ -31,2 +31,4 @@ /**

return str;
} else if (typeof Methods[method] === 'object') {
return Methods[method].encode(str, arguments[2]);
}

@@ -42,2 +44,4 @@

return str;
} else if (typeof Methods[method] === 'object') {
return Methods[method].decode(str, arguments[2]);
}

@@ -48,2 +52,4 @@

console.log(exports.decode('AER256', '278, 278, 22', 'aaey'));
exports.getSupportedMethods = function () {

@@ -50,0 +56,0 @@ return Object.keys(Methods);

{
"name": "crypo",
"version": "0.1.2",
"version": "0.1.3",
"main": "lib/Crypo.js",

@@ -5,0 +5,0 @@ "repository": "crypo/crypo",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc