网页字体加密原理(学习通为例)
目录
前言
使用学习通网页做题的时候,想复制题目,结果得到的是乱码,打开源码一看,原来是对字体进行了加密

原理分析
unicode
unicode规定了汉字的编码,如干
这个字对应的unicode编码是uni5E72
比如我下载了一个字体,用软件打开如fontCreator
,就可以找到

学习通怎么做的
这道题中,这几个字是font-cxsecret
字体,这个字体,就是学习通的加密字体,这个字体的位置可以在head中找到


把这个加密字体保存下来打开

好像并没有啥问题,实际上并不是,我拿电
举例,在学习通的字体中,编号为uni5B24
,但在常规字体中,电
的编号是uni7535
学习通字体规定的uni5B24
的形状

常规字体,或者说unicode规定uni5B24
的形状

回到网页,我们可以看到,电
对应的就是嬤

结论
学习通这招不可谓很巧(yin)妙(xian),总的来说,学习通的字体加密有以下几步
-
在这道题目中随机选择几个字,进行加密,如要加密
电
这个字,先把电
的字体形状找到,让这个字体形状对上另一个编号如uni5B24
,生成字体,字体中包含加密的字 -
把原来网页中正常的字改成加密后的编码
-
让加密字的字体属于加密字体
ref
https://blog.csdn.net/litang199612/article/details/83413002
https://blog.csdn.net/qq_35741999/article/details/82018049
没想到是直接生成了新的字体文件
那么是怎么通过新的字体文件中的编码,推算出原来是什么字的呢?
比如说uni5B24,打开加密字体人一看就知道是电,但机器怎么从uni5B24推出原来的是uni7535呢,总不能ocr吧
或者说这个替换是有规律的?
v1.4.16