pull/103/head
刘河 2019-03-20 00:26:17 +08:00
parent a4d429bbc1
commit 24bd9ce6ba
2 changed files with 6 additions and 1 deletions

View File

@ -1774,6 +1774,10 @@ POST /auth/getauthkey
将返回加密后的authKey采用aes cbc加密请使用与服务端配置文件中cryptKey相同的密钥进行解密 将返回加密后的authKey采用aes cbc加密请使用与服务端配置文件中cryptKey相同的密钥进行解密
**注意:** nps配置文件中`auth_crypt_key`需为16位 **注意:** nps配置文件中`auth_crypt_key`需为16位
- 解密密钥长度128
- 偏移量与密钥相同
- 补码方式pkcs5padding
- 解密串编码方式 十六进制
### 详细文档 ### 详细文档
- 此文档近期可能更新较慢,建议自行抓包 - 此文档近期可能更新较慢,建议自行抓包

View File

@ -1,6 +1,7 @@
package controllers package controllers
import ( import (
"encoding/hex"
"github.com/cnlh/nps/lib/crypt" "github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/vender/github.com/astaxie/beego" "github.com/cnlh/nps/vender/github.com/astaxie/beego"
) )
@ -25,7 +26,7 @@ func (s *AuthController) GetAuthKey() {
return return
} }
m["status"] = 1 m["status"] = 1
m["crypt_auth_key"] = string(b) m["crypt_auth_key"] = hex.EncodeToString(b)
m["crypt_type"] = "aes cbc" m["crypt_type"] = "aes cbc"
return return
} }