GoForum🌐 V2EX

基于千问大模型的中文自然语言隐写术

iamnottsh · 2026-03-03 17:27 · 0 次点赞 · 3 条回复

能输入任意格式的文件,并且输出始终较短,输出长度与输入文件大小无关,原理是先用两个中文汉字作为标识符,再用 ai 造句

Demo:清冷仙子哦齁齁齁.xyz

例如:

山间清
泉潺潺流过,恰逢
戊日,村民依俗取水祈福。

能解出:

你好,世界!

为了能活得久一点,选择闭源

这里贴出核心代码(注意前端要把括号替换为换行符):

import type { ChatCompletion } from "openai/resources.js";
import { httpAction } from "./_generated/server";
import OpenAI from 'openai';

export default httpAction(async (_, req) => {
    try {
        const word = new URL(req.url).searchParams.get('word');
        if (!word) return new Response("Missing 'word' parameter", {
            status: 400
        });
        const [w0, w1] = word
        if (!w0 || !w1) return new Response("Length must be 2", {
            status: 400
        });
        const openai = new OpenAI({
            baseURL: "https://apis.iflow.cn/v1",
            apiKey: "你的 apiKey" // todo 填写 apiKey
        });
        for (;;) {
            const completion: ChatCompletion = await openai.chat.completions.create({
                model: "qwen3-max",
                messages: [
                    {
                        "role": "system",
                        "content": `你是句子生成器,按用户的要求输出一个句子,必须避免敏感。现在是${new Date()}。`
                    },
                    {
                        "role": "user",
                        "content": `用“${w0}”“${w1}”造句,“${w0}”在前“${w1}”在后,但不能放在句首。如果可以,减少以“他”开头,实在不行也没办法。`
                    }
                ],
            });
            const content = completion.choices[0]?.message.content
            if (!content || !content.includes(w0) || !content.includes(w1) || content.startsWith(w0) || content.indexOf(w0) > content.indexOf(w1)) continue;
            const newHeaders = new Headers();
            newHeaders.set('Access-Control-Allow-Origin', 'https://saozi5-75am.ipfs.4everland.app');
            return new Response(content.replace(w0, `「${w0}」`).replace(w1, `「${w1}」`), {
                headers: newHeaders
            });
        }
    } catch (e) {
        return new Response(String(e), {
            status: 500
        });
    }
})

3 条回复
bigtear · 2026-03-03 17:32
#1

你这个域名有点东西啊

iamnottsh · 2026-03-03 17:37
#2

@bigtear 长中文域名非常便宜,我建议大家都用抽象思维买域名

zoharSoul · 2026-03-03 17:47
#3

什么意思, 没看懂啊…

添加回复
你还需要 登录 后发表回复

登录后可发帖和回复

登录 注册
主题信息
作者: iamnottsh
发布: 2026-03-03
点赞: 0
回复: 0