mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
VID Hash method
This commit is contained in:
parent
d785fa0156
commit
2566fc3d14
@ -35,7 +35,7 @@
|
||||
数据部分
|
||||
* N 字节:请求数据
|
||||
|
||||
其中指令部分经过 AES-128 加密,Key 为用户 VID;数据部分使用 AES-128-CBC 加密
|
||||
其中指令部分经过 AES-128 加密,Key 为 md5(用户 VID + 'PWD');数据部分使用 AES-128-CBC 加密
|
||||
|
||||
## 数据应答
|
||||
认证部分:
|
||||
|
8
vid.go
8
vid.go
@ -1,6 +1,7 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
)
|
||||
@ -8,6 +9,13 @@ import (
|
||||
// The ID of en entity, in the form of an UUID.
|
||||
type VID [16]byte
|
||||
|
||||
func (v VID) Hash(suffix []byte) []byte {
|
||||
md5 := md5.New()
|
||||
md5.Write(v[:])
|
||||
md5.Write(suffix)
|
||||
return md5.Sum(nil)
|
||||
}
|
||||
|
||||
var byteGroups = []int{8, 4, 4, 4, 12}
|
||||
|
||||
// TODO: leverage a full functional UUID library
|
||||
|
5
vuserset.go
Normal file
5
vuserset.go
Normal file
@ -0,0 +1,5 @@
|
||||
package core
|
||||
|
||||
type VUserSet struct {
|
||||
validUserIds [][]byte
|
||||
}
|
Loading…
Reference in New Issue
Block a user