本文最后更新于:2023年12月4日 晚上
                  
                
              
            
            
              
                
                前言
使用学校webvpn时候,访问内网地址被加密为一串字符串,
例如:https://webvpn.gdou.edu.cn/http/77726476706e69737468656265737421a1a70fce77602606305adcf9/
加密流程
通过前端js代码,可以很清楚的找到加密函数
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 
 | var textRightAppend = function (text, mode) {var segmentByteSize = mode === 'utf8' ? 16 : 32
 
 if (text.length % segmentByteSize === 0) {
 return text
 }
 
 var appendLength = segmentByteSize - text.length % segmentByteSize
 var i = 0
 while (i++ < appendLength) {
 text += '0'
 }
 return text
 }
 
 var encrypt = function (text, key, iv) {
 var textLength = text.length
 text = textRightAppend(text, 'utf8')
 var keyBytes = utf8.toBytes(key)
 var ivBytes = utf8.toBytes(iv)
 var textBytes = utf8.toBytes(text)
 var aesCfb = new AesCfb(keyBytes, ivBytes, 16)
 var encryptBytes = aesCfb.encrypt(textBytes)
 return hex.fromBytes(ivBytes) + hex.fromBytes(encryptBytes).slice(0, textLength * 2)
 }
 
 | 
其中 key = “wrdvpnisthebest!” iv = “wrdvpnisthebest!” 默认参数
加密方式根据函数猜测为Aes加密,模式为cfb方式