mirror of
https://github.com/ehang-io/nps.git
synced 2025-07-03 13:10:42 +00:00
Auth key
This commit is contained in:
parent
a4d429bbc1
commit
24bd9ce6ba
@ -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
|
||||||
|
- 解密串编码方式 十六进制
|
||||||
|
|
||||||
### 详细文档
|
### 详细文档
|
||||||
- 此文档近期可能更新较慢,建议自行抓包
|
- 此文档近期可能更新较慢,建议自行抓包
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user