Skip to content

Commit

Permalink
Added crypto-utils.js as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jan 27, 2025
1 parent 35b4c21 commit 245ae8d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 51 deletions.
6 changes: 3 additions & 3 deletions amazongpt/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default [
languageOptions: {
ecmaVersion: 'latest', sourceType: 'script',
globals: {
...globals.browser, ...globals.greasemonkey,
chatgpt: 'readonly', CryptoJS: 'readonly', GM_cookie: 'readonly', hljs: 'readonly',
ipv4: 'readonly', marked: 'readonly', renderMathInElement: 'readonly'
...globals.browser, ...globals.greasemonkey, chatgpt: 'readonly', CryptoJS: 'readonly',
cryptoUtils: 'readonly', GM_cookie: 'readonly', hljs: 'readonly', ipv4: 'readonly', marked: 'readonly',
renderMathInElement: 'readonly'
}
},
plugins: { 'import': importPlugin, 'js-styles': stylisticJS, regexp },
Expand Down
12 changes: 3 additions & 9 deletions amazongpt/greasemonkey/amazongpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Adds the magic of AI to Amazon shopping
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.14
// @version 2025.1.26.15
// @license MIT
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
Expand Down Expand Up @@ -60,6 +60,7 @@
// @connect toyaml.com
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.5.0/dist/chatgpt.min.js#sha256-+C0x4BOFQc38aZB3pvUC2THu+ZSvuCxRphGdtRLjCDg=
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js#sha256-dppVXeVTurw1ozOPNE3XqhYmDJPOosfbKQcHyQSE58w=
// @require https://assets.aiwebextensions.com/lib/crypto-utils.js?v=35b4c21#sha256-LHUbqrdOuPpVHkihzZE1PlWFvZMeHiM0uJ32SER11TI=
// @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js#sha256-aQQKAQcMgCu8IpJp9HKs387x0uYxngO+Fb4pc5nSF4I=
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js#sha256-g3pvpbDHNrUrveKythkPMF2j/J7UFoHbUyFQcFe1yEY=
// @require https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js#sha256-n0UwfFeU7SR6DQlfOmLlLvIhWmeyMnIDp/2RmVmuedE=
Expand Down Expand Up @@ -2519,7 +2520,7 @@
userId: apis.AIchatOS.userID, withoutContext: false
} : api == 'FREEGPT' ? {
messages: msgs, pass: null,
sign: await crypto.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
sign: await cryptoUtils.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
time: time
} : api == 'GPTforLove' ? {
prompt: lastUserMsg.content, secret: session.generateGPTFLkey(),
Expand Down Expand Up @@ -3077,13 +3078,6 @@
}
}

// Define CRYPTO utilities

const crypto = { // requires CryptoJS
async digestMessage(msg) { return CryptoJS.SHA256(msg).toString(CryptoJS.enc.Hex) },
async generateSignature({ time, msg, pkey }) { return await this.digestMessage(`${time}:${msg}:${pkey}`) }
}

// Run MAIN routine

menu.register()
Expand Down
6 changes: 3 additions & 3 deletions bravegpt/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default [
languageOptions: {
ecmaVersion: 'latest', sourceType: 'script',
globals: {
...globals.browser, ...globals.greasemonkey,
chatgpt: 'readonly', CryptoJS: 'readonly', GM_cookie: 'readonly', hljs: 'readonly',
ipv4: 'readonly', marked: 'readonly', renderMathInElement: 'readonly'
...globals.browser, ...globals.greasemonkey, chatgpt: 'readonly', CryptoJS: 'readonly',
cryptoUtils: 'readonly', GM_cookie: 'readonly', hljs: 'readonly', ipv4: 'readonly', marked: 'readonly',
renderMathInElement: 'readonly'
}
},
plugins: { 'import': importPlugin, 'js-styles': stylisticJS, regexp },
Expand Down
12 changes: 3 additions & 9 deletions bravegpt/greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.14
// @version 2025.1.26.15
// @license MIT
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
Expand Down Expand Up @@ -182,6 +182,7 @@
// @connect toyaml.com
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.5.0/dist/chatgpt.min.js#sha256-+C0x4BOFQc38aZB3pvUC2THu+ZSvuCxRphGdtRLjCDg=
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js#sha256-dppVXeVTurw1ozOPNE3XqhYmDJPOosfbKQcHyQSE58w=
// @require https://assets.aiwebextensions.com/lib/crypto-utils.js?v=35b4c21#sha256-LHUbqrdOuPpVHkihzZE1PlWFvZMeHiM0uJ32SER11TI=
// @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js#sha256-aQQKAQcMgCu8IpJp9HKs387x0uYxngO+Fb4pc5nSF4I=
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js#sha256-g3pvpbDHNrUrveKythkPMF2j/J7UFoHbUyFQcFe1yEY=
// @require https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js#sha256-n0UwfFeU7SR6DQlfOmLlLvIhWmeyMnIDp/2RmVmuedE=
Expand Down Expand Up @@ -3216,7 +3217,7 @@
userId: apis.AIchatOS.userID, withoutContext: false
} : api == 'FREEGPT' ? {
messages: msgs, pass: null,
sign: await crypto.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
sign: await cryptoUtils.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
time: time
} : api == 'GPTforLove' ? {
prompt: lastUserMsg.content, secret: session.generateGPTFLkey(),
Expand Down Expand Up @@ -3964,13 +3965,6 @@
}
}

// Define CRYPTO utilities

const crypto = { // requires CryptoJS
async digestMessage(msg) { return CryptoJS.SHA256(msg).toString(CryptoJS.enc.Hex) },
async generateSignature({ time, msg, pkey }) { return await this.digestMessage(`${time}:${msg}:${pkey}`) }
}

// Run MAIN routine

menu.register()
Expand Down
6 changes: 3 additions & 3 deletions duckduckgpt/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default [
languageOptions: {
ecmaVersion: 'latest', sourceType: 'script',
globals: {
...globals.browser, ...globals.greasemonkey,
chatgpt: 'readonly', CryptoJS: 'readonly', GM_cookie: 'readonly', hljs: 'readonly',
ipv4: 'readonly', marked: 'readonly', renderMathInElement: 'readonly'
...globals.browser, ...globals.greasemonkey, chatgpt: 'readonly', CryptoJS: 'readonly',
cryptoUtils: 'readonly', GM_cookie: 'readonly', hljs: 'readonly', ipv4: 'readonly', marked: 'readonly',
renderMathInElement: 'readonly'
}
},
plugins: { 'import': importPlugin, 'js-styles': stylisticJS, regexp },
Expand Down
12 changes: 3 additions & 9 deletions duckduckgpt/greasemonkey/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.15
// @version 2025.1.26.16
// @license MIT
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
Expand Down Expand Up @@ -183,6 +183,7 @@
// @connect toyaml.com
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.5.0/dist/chatgpt.min.js#sha256-+C0x4BOFQc38aZB3pvUC2THu+ZSvuCxRphGdtRLjCDg=
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js#sha256-dppVXeVTurw1ozOPNE3XqhYmDJPOosfbKQcHyQSE58w=
// @require https://assets.aiwebextensions.com/lib/crypto-utils.js?v=35b4c21#sha256-LHUbqrdOuPpVHkihzZE1PlWFvZMeHiM0uJ32SER11TI=
// @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js#sha256-aQQKAQcMgCu8IpJp9HKs387x0uYxngO+Fb4pc5nSF4I=
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js#sha256-g3pvpbDHNrUrveKythkPMF2j/J7UFoHbUyFQcFe1yEY=
// @require https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js#sha256-n0UwfFeU7SR6DQlfOmLlLvIhWmeyMnIDp/2RmVmuedE=
Expand Down Expand Up @@ -3103,7 +3104,7 @@
userId: apis.AIchatOS.userID, withoutContext: false
} : api == 'FREEGPT' ? {
messages: msgs, pass: null,
sign: await crypto.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
sign: await cryptoUtils.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
time: time
} : api == 'GPTforLove' ? {
prompt: lastUserMsg.content, secret: session.generateGPTFLkey(),
Expand Down Expand Up @@ -3841,13 +3842,6 @@
}
}

// Define CRYPTO utilities

const crypto = { // requires CryptoJS
async digestMessage(msg) { return CryptoJS.SHA256(msg).toString(CryptoJS.enc.Hex) },
async generateSignature({ time, msg, pkey }) { return await this.digestMessage(`${time}:${msg}:${pkey}`) }
}

// Run MAIN routine

menu.register()
Expand Down
6 changes: 3 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default [
ecmaVersion: 'latest', sourceType: 'script',
globals: {
...globals.browser, ...globals.greasemonkey, ...globals.node, buttons: 'writable', chatgpt: 'readonly',
chrome: 'readonly', config: 'writable', CryptoJS: 'readonly', dom: 'readonly', GM_cookie: 'readonly',
hljs: 'readonly', icons: 'writable', ipv4: 'readonly', marked: 'readonly', modals: 'writable',
renderMathInElement: 'readonly', settings: 'writable', toggles: 'writable'
chrome: 'readonly', config: 'writable', CryptoJS: 'readonly', cryptoUtils: 'readonly', dom: 'readonly',
GM_cookie: 'readonly', hljs: 'readonly', icons: 'writable', ipv4: 'readonly', marked: 'readonly',
modals: 'writable', renderMathInElement: 'readonly', settings: 'writable', toggles: 'writable'
}
},
plugins: { 'import': importPlugin, 'js-styles': stylisticJS, regexp },
Expand Down
6 changes: 3 additions & 3 deletions googlegpt/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default [
languageOptions: {
ecmaVersion: 'latest', sourceType: 'script',
globals: {
...globals.browser, ...globals.greasemonkey,
chatgpt: 'readonly', CryptoJS: 'readonly', GM_cookie: 'readonly', hljs: 'readonly',
ipv4: 'readonly', marked: 'readonly', renderMathInElement: 'readonly'
...globals.browser, ...globals.greasemonkey, chatgpt: 'readonly', CryptoJS: 'readonly',
cryptoUtils: 'readonly', GM_cookie: 'readonly', hljs: 'readonly', ipv4: 'readonly', marked: 'readonly',
renderMathInElement: 'readonly'
}
},
plugins: { 'import': importPlugin, 'js-styles': stylisticJS, regexp },
Expand Down
12 changes: 3 additions & 9 deletions googlegpt/greasemonkey/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.26.14
// @version 2025.1.26.15
// @license MIT
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
Expand Down Expand Up @@ -373,6 +373,7 @@
// @connect toyaml.com
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.5.0/dist/chatgpt.min.js#sha256-+C0x4BOFQc38aZB3pvUC2THu+ZSvuCxRphGdtRLjCDg=
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js#sha256-dppVXeVTurw1ozOPNE3XqhYmDJPOosfbKQcHyQSE58w=
// @require https://assets.aiwebextensions.com/lib/crypto-utils.js?v=35b4c21#sha256-LHUbqrdOuPpVHkihzZE1PlWFvZMeHiM0uJ32SER11TI=
// @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js#sha256-aQQKAQcMgCu8IpJp9HKs387x0uYxngO+Fb4pc5nSF4I=
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js#sha256-g3pvpbDHNrUrveKythkPMF2j/J7UFoHbUyFQcFe1yEY=
// @require https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js#sha256-n0UwfFeU7SR6DQlfOmLlLvIhWmeyMnIDp/2RmVmuedE=
Expand Down Expand Up @@ -3397,7 +3398,7 @@
userId: apis.AIchatOS.userID, withoutContext: false
} : api == 'FREEGPT' ? {
messages: msgs, pass: null,
sign: await crypto.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
sign: await cryptoUtils.generateSignature({ time: time, msg: lastUserMsg.content, pkey: '' }),
time: time
} : api == 'GPTforLove' ? {
prompt: lastUserMsg.content, secret: session.generateGPTFLkey(),
Expand Down Expand Up @@ -4155,13 +4156,6 @@
}
}

// Define CRYPTO utilities

const crypto = { // requires CryptoJS
async digestMessage(msg) { return CryptoJS.SHA256(msg).toString(CryptoJS.enc.Hex) },
async generateSignature({ time, msg, pkey }) { return await this.digestMessage(`${time}:${msg}:${pkey}`) }
}

// Run MAIN routine

menu.register()
Expand Down

0 comments on commit 245ae8d

Please sign in to comment.