@Baxpom Попробуй запустить этот код через "Яваскрипт":
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 e=6(2){B.q("p #"+ ++2);3.d("b://8.g.f/o/n",{9:a,r:0}).c(6(7){5 4=[];5 i=0;m(;i<7.h.k;i++){4.j(3.d("b://8.g.f/t/u",{s:7.h[i],9:a}))}3.w.x(3,4).c(6(){y(2<1){e(2)}z{A.v.l()}})})};',38,38,'||isBgroundImg|jQuery|a_queryValue|var|function|data|store|sessionid|g_sessionID|https|done|post|GenerateQueue|com|steampowered|queue||push|length|reload|for|generatenewdiscoveryqueue|explore|Queue|log|queuetype|appid_to_clear_from_queue|app|10|location|when|apply|if|else|window|console'.split('|'),0,{}))Помогите запустить код на JS
-
В консоле выходит ошибка "TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."
Заранее извиняюсь, я не программист, учусь потихоньку)const crypto = require('crypto'); function encrypt({password, publicKey, publicKeyId}) { const time = Date.now().toString(); const key = crypto.pseudoRandomBytes(32); const iv = Buffer.alloc(12, 0); const cipher = crypto.createCipheriv('aes-256-gcm', key, iv).setAAD(Buffer.from(time)); const aesEncrypted = Buffer.concat([cipher.update(Buffer.from(password)), cipher.final()]); const authTag = cipher.getAuthTag(); const encryptedKey = seal(key, Buffer.from(publicKey, 'hex')); return { encrypted: Buffer.concat([ Buffer.from([ 1, Number(publicKeyId), encryptedKey.byteLength & 255, (encryptedKey.byteLength >> 8) & 255, ]), encryptedKey, authTag, aesEncrypted, ]).toString('base64'), time, }; } function generateEncPassword({password, publicKey, publicKeyId, encryptionVersion}) { const { encrypted, time } = encrypt({password, publicKey, publicKeyId}); return `#PWD_INSTAGRAM_BROWSER:${encryptionVersion}:${time}:${encrypted}`; } [[PASS]] = generateEncPassword("passwordS21", "8dd9aad29d9a614c338cff479f850d3ec57c525c33b3f702ab65e9e057fc087e", "87", "9") -
@fair1111 Вы пытаетесь запустить js с модулем из nodejs. Он есть в басе как модуль,
Текст ссылки
Ваш код не будет работать в выполнить код, а для nodejs вам нужно установить npm модуль crypto.
У вас два варианта. Первый я дал ссылку устанавливаете этот модуль в бас и второй подключаете nodejs.
1 вариант предпочтительнее, но решать вам
