diff --git a/api/crypto/rsa.ts b/api/crypto/rsa.ts index 0606284..5836075 100644 --- a/api/crypto/rsa.ts +++ b/api/crypto/rsa.ts @@ -1,13 +1,23 @@ import * as crypto from "crypto"; +const BLOCK_SIZE=256 +const MAX_CHUNK_SIZE=BLOCK_SIZE-11 // 11 is the PCKS1 padding + export function encrypt(key, txt){ try{ + const buf = Buffer.from(txt) + let finalBuf = Buffer.from([]) + const n = Math.ceil(buf.length/MAX_CHUNK_SIZE) + const arr = Array(n).fill(0) const pubc = cert.pub(key) - const buf = crypto.publicEncrypt({ - key:pubc, - padding:crypto.constants.RSA_PKCS1_PADDING, - }, Buffer.from(txt,'utf-8')) - return buf.toString('base64') + arr.forEach((_,i)=>{ + const f = crypto.publicEncrypt({ + key:pubc, + padding:crypto.constants.RSA_PKCS1_PADDING, + }, buf.subarray(i*MAX_CHUNK_SIZE,i*MAX_CHUNK_SIZE+MAX_CHUNK_SIZE)) + finalBuf = Buffer.concat([finalBuf,f]) + }) + return finalBuf.toString('base64') } catch(e) { return '' } @@ -15,12 +25,19 @@ export function encrypt(key, txt){ export function decrypt(privateKey, enc){ try{ + const buf = Buffer.from(enc, 'base64') + let finalDec = '' + const n = Math.ceil(buf.length/BLOCK_SIZE) + const arr = Array(n).fill(0) const privc = cert.priv(privateKey) - const buf = crypto.privateDecrypt({ - key:privc, - padding:crypto.constants.RSA_PKCS1_PADDING, - }, Buffer.from(enc,'base64')) - return buf.toString('utf-8') + arr.forEach((_,i)=>{ + const b = crypto.privateDecrypt({ + key:privc, + padding:crypto.constants.RSA_PKCS1_PADDING, + }, buf.subarray(i*BLOCK_SIZE,i*BLOCK_SIZE+BLOCK_SIZE)) + finalDec += b.toString('utf-8') + }) + return finalDec } catch(e) { return '' } @@ -50,7 +67,7 @@ export function genKeys(): Promise<{[k:string]:string}>{ export function testRSA(){ crypto.generateKeyPair('rsa', { modulusLength: 2048 - }, (err, publicKey, priv)=>{ + }, (err, publicKey, privateKey)=>{ const pubPEM = publicKey.export({ type:'pkcs1',format:'pem' }) @@ -59,8 +76,13 @@ export function testRSA(){ const msg = 'hi' const enc = encrypt(pub, msg) + const privPEM = privateKey.export({ + type:'pkcs1',format:'pem' + }) + const priv = cert.unpriv(privPEM) + const dec = decrypt(priv, enc) - console.log("FINAL:",dec) + console.log("SUCESS:",msg===dec) }) } diff --git a/app.ts b/app.ts index 512a7aa..19a1459 100644 --- a/app.ts +++ b/app.ts @@ -11,6 +11,7 @@ import {setupDatabase, setupDone} from './api/utils/setup' import * as controllers from './api/controllers' import * as socket from './api/utils/socket' import * as network from './api/network' +import * as rsa from './api/crypto/rsa' let server: any = null const port = process.env.PORT || 3001; @@ -25,6 +26,8 @@ var i = 0 connectToLND() async function connectToLND(){ + rsa.testRSA() + return i++ console.log(`=> [lnd] connecting... attempt #${i}`) try { diff --git a/dist/api/controllers/chatTribes.js b/dist/api/controllers/chatTribes.js index 759ef17..1445dbc 100644 --- a/dist/api/controllers/chatTribes.js +++ b/dist/api/controllers/chatTribes.js @@ -112,7 +112,6 @@ function editTribe(req, res) { let okToUpdate = true; if (is_listed) { try { - console.log("LLLLL", escrow_amount, escrow_millis); yield tribes.edit({ uuid: chat.uuid, name: name, diff --git a/dist/api/controllers/chatTribes.js.map b/dist/api/controllers/chatTribes.js.map index d140ed1..6deb117 100644 --- a/dist/api/controllers/chatTribes.js.map +++ b/dist/api/controllers/chatTribes.js.map @@ -1 +1 @@ -{"version":3,"file":"chatTribes.js","sourceRoot":"","sources":["../../../api/controllers/chatTribes.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,qCAAoC;AACpC,0CAAyC;AACzC,6BAA4B;AAC5B,sCAA+D;AAC/D,yCAA8B;AAE9B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAe,SAAS,CAAC,GAAG,E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,IAAI;YACf,QAAQ,EAAE,GAAG,IAAE,EAAE;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK;YAChC,QAAQ,EAAE,IAAI,CAAC,MAAM;YACrB,eAAe,EAAE,IAAI,CAAC,OAAO;YAC7B,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;YACtB,eAAe,EAAE,iBAAiB,IAAE,CAAC;YACrC,WAAW,EAAE,aAAa,IAAE,CAAC;YAC7B,YAAY,EAAE,aAAa,IAAE,CAAC;YAC9B,YAAY,EAAE,aAAa,IAAE,CAAC;SAC9B,CAAA;IACF,CAAC;CAAA;AAKG,sDAAqB;AAGzB,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/api/crypto/rsa.js b/dist/api/crypto/rsa.js index 4a46756..76f02e8 100644 --- a/dist/api/crypto/rsa.js +++ b/dist/api/crypto/rsa.js @@ -1,14 +1,23 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const crypto = require("crypto"); +const BLOCK_SIZE = 256; +const MAX_CHUNK_SIZE = BLOCK_SIZE - 11; // 11 is the PCKS1 padding function encrypt(key, txt) { try { + const buf = Buffer.from(txt); + let finalBuf = Buffer.from([]); + const n = Math.ceil(buf.length / MAX_CHUNK_SIZE); + const arr = Array(n).fill(0); const pubc = cert.pub(key); - const buf = crypto.publicEncrypt({ - key: pubc, - padding: crypto.constants.RSA_PKCS1_PADDING, - }, Buffer.from(txt, 'utf-8')); - return buf.toString('base64'); + arr.forEach((_, i) => { + const f = crypto.publicEncrypt({ + key: pubc, + padding: crypto.constants.RSA_PKCS1_PADDING, + }, buf.subarray(i * MAX_CHUNK_SIZE, i * MAX_CHUNK_SIZE + MAX_CHUNK_SIZE)); + finalBuf = Buffer.concat([finalBuf, f]); + }); + return finalBuf.toString('base64'); } catch (e) { return ''; @@ -17,12 +26,19 @@ function encrypt(key, txt) { exports.encrypt = encrypt; function decrypt(privateKey, enc) { try { + const buf = Buffer.from(enc, 'base64'); + let finalDec = ''; + const n = Math.ceil(buf.length / BLOCK_SIZE); + const arr = Array(n).fill(0); const privc = cert.priv(privateKey); - const buf = crypto.privateDecrypt({ - key: privc, - padding: crypto.constants.RSA_PKCS1_PADDING, - }, Buffer.from(enc, 'base64')); - return buf.toString('utf-8'); + arr.forEach((_, i) => { + const b = crypto.privateDecrypt({ + key: privc, + padding: crypto.constants.RSA_PKCS1_PADDING, + }, buf.subarray(i * BLOCK_SIZE, i * BLOCK_SIZE + BLOCK_SIZE)); + finalDec += b.toString('utf-8'); + }); + return finalDec; } catch (e) { return ''; @@ -53,15 +69,19 @@ exports.genKeys = genKeys; function testRSA() { crypto.generateKeyPair('rsa', { modulusLength: 2048 - }, (err, publicKey, priv) => { + }, (err, publicKey, privateKey) => { const pubPEM = publicKey.export({ type: 'pkcs1', format: 'pem' }); const pub = cert.unpub(pubPEM); const msg = 'hi'; const enc = encrypt(pub, msg); + const privPEM = privateKey.export({ + type: 'pkcs1', format: 'pem' + }); + const priv = cert.unpriv(privPEM); const dec = decrypt(priv, enc); - console.log("FINAL:", dec); + console.log("SUCESS:", msg === dec); }); } exports.testRSA = testRSA; diff --git a/dist/api/crypto/rsa.js.map b/dist/api/crypto/rsa.js.map index cbebda6..99f7d2b 100644 --- a/dist/api/crypto/rsa.js.map +++ b/dist/api/crypto/rsa.js.map @@ -1 +1 @@ -{"version":3,"file":"rsa.js","sourceRoot":"","sources":["../../../api/crypto/rsa.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEjC,SAAgB,OAAO,CAAC,GAAG,EAAE,GAAG;IAC9B,IAAG;QACD,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C,UAAS,GAAG;QACf,OAAO,mCAAmC;YACxC,GAAG,GAAG,IAAI;YACV,+BAA+B,CAAA;IACnC,CAAC;CACF,CAAA"} \ No newline at end of file diff --git a/dist/api/utils/tribes.js b/dist/api/utils/tribes.js index e8a5948..bf2dcb4 100644 --- a/dist/api/utils/tribes.js +++ b/dist/api/utils/tribes.js @@ -126,15 +126,6 @@ function edit({ uuid, host, name, description, tags, img, price_per_message, pri }), headers: { 'Content-Type': 'application/json' } }); - console.log(JSON.stringify({ - uuid, - name, description, tags, img: img || '', - price_per_message: price_per_message || 0, - price_to_join: price_to_join || 0, - escrow_amount: escrow_amount || 0, - escrow_millis: escrow_millis || 0, - owner_alias, - })); // const j = await r.json() } catch (e) { diff --git a/dist/api/utils/tribes.js.map b/dist/api/utils/tribes.js.map index 3124661..bc84594 100644 --- a/dist/api/utils/tribes.js.map +++ b/dist/api/utils/tribes.js.map @@ -1 +1 @@ -{"version":3,"file":"tribes.js","sourceRoot":"","sources":["../../../api/utils/tribes.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,iCAAgC;AAChC,qCAAoC;AACpC,mCAAkC;AAClC,6BAA4B;AAC5B,6BAA4B;AAC5B,oCAAmC;AACnC,sCAAkC;AAElC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,IAAI,MAAW,CAAA;AAEf,SAAsB,OAAO,CAAC,SAAS;;QACrC,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,OAAO,EAAE,CAAA;YAEhC,SAAe,SAAS;;oBACtB,MAAM,GAAG,IAAI,CAAA;oBACb,MAAM,GAAG,GAAG,MAAM,kBAAkB,EAAE,CAAA;oBACtC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,SAAS,MA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SAChB;aAAM;YACL,OAAO,KAAK,CAAA;SACb;IACH,CAAC;CAAA;AAVD,sDAUC;AAED,SAAgB,OAAO;IACrB,OAAO,MAAM,CAAC,WAAW,IAAI,EAAE,CAAA;AACjC,CAAC;AAFD,0BAEC;AAED,SAAS,SAAS,CAAC,GAAG;IACpB,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACvE,CAAC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/app.js b/dist/app.js index 685dcb2..4a1f89b 100644 --- a/dist/app.js +++ b/dist/app.js @@ -22,6 +22,7 @@ const setup_1 = require("./api/utils/setup"); const controllers = require("./api/controllers"); const socket = require("./api/utils/socket"); const network = require("./api/network"); +const rsa = require("./api/crypto/rsa"); let server = null; const port = process.env.PORT || 3001; const env = process.env.NODE_ENV || 'development'; @@ -32,6 +33,8 @@ var i = 0; connectToLND(); function connectToLND() { return __awaiter(this, void 0, void 0, function* () { + rsa.testRSA(); + return; i++; console.log(`=> [lnd] connecting... attempt #${i}`); try { diff --git a/dist/app.js.map b/dist/app.js.map index 7b878ba..024e8ad 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,iCAAgC;AAChC,6BAA4B;AAC5B,yCAAmC;AACn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