FFAX Protocol 2 dev
Welcome to FFAX Protocol v2
Quick start
go get github.com/RealFax/FFAX
func example() {
listener, err := net.Listen("tcp", "0.0.0.0:8080")
if err != nil {
log.Error(err.Error())
return
}
for {
var conn net.Conn
var err error
var key, data []byte
if conn, err = listener.Accept(); err != nil {
log.Error(err.Error())
continue
}
if key, err = packet.AesSecretExchange(conn); err != nil {
log.Error(err.Error())
continue
}
if data, err = crypto.Aes([]byte("Hello, FFAX Protocol"), key).Encrypt(); err != nil {
log.Error(err.Error())
continue
}
conn.Write(data)
}
}
👀
Quick preview of this update
- Use AES-128 encryption to make the protocol more efficient
- Use gZip to optimize packet size
- Solved the placeholder issue
- Solved the problem that part of the text could cause
panic
(slice subscript offset) - Provide a non-intrusive and safer key exchange function
- Key generator (to extract the key from Hash with the idea of reliance)
Header
- Change the previous
map[string]string
tomap[string][]byte
This will allow you to store more types of things in the header, no matter the key of the binary stream or the HMAC, or even a piece of audio and video - Allow users to customize the placeholder
src/packet/const.go
-Advanced coding method, FFAX Protocol v2 uses a lot of human readable content to reduce code redundancy and improve readability Header
nesting,RealFax
encourages people to dare to innovate, although we do not provide such an operation to implement nestedHeader
, but this type offunc
may be added in the futurestruct
binding, maybe this can also bind astruct
?
Message
- Message allows you to store various contents, which is different from
Header
. AlthoughHeader
can store[]byte
, we do not recommend storing some content inHeader
- This version of FFAX Protocol allows
Message
to store more bytes. You can implement oversized files, oversized audio and video streams, and VOIP audio and video calls here
🚫
Signature
- We have removed
Signature
from the FFAX Protocol in this version, because it is unnecessary and will increase your system burden/risk -New solution: You can storeSignature
inHeader
,Header
allows you to confuse Key
👎
shortcoming
- Binary linear storage (in large data packet scenarios will cause performance degradation), the solution: cut the content into several equal parts, set the current
Message hash
,timestamp
,Index
,Next packet in the
Headerhash
- Original decoding method (array cutting)
✨
Personalization
🔣
Placeholder
We allow you to modify the placeholders in the data packet. The placeholders are defined in src/packet/const.go
, you can see three hexadecimal placeholder constants
global int64 = 0xFFAACC01
header int64 = 0xFFABCC02
kv int64 = 0xFFACCC03
Of course, we do not recommend that you modify these default values. If you need to modify these for some reason, we recommend that you follow the following standards- Hexadecimal string starting with 0x
- The minimum length is 4 digits such as
0xFFFF0
- Don't reveal your placeholder to others
⚡
2.1.0
⚡
alpha project
- Use Intel AES-NI to optimize AES encryption and decryption
- Use Intel RNG technology to enhance the security of the key
- Do not use linear storage, use other