mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 19:12:04 +08:00
初步的虚拟机vnc连接
This commit is contained in:
19
novnc-client/qvncwidget/rfbdes.py
Normal file
19
novnc-client/qvncwidget/rfbdes.py
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
import pyDes
|
||||
|
||||
class RFBDes(pyDes.des):
|
||||
def setKey(self, key):
|
||||
"""
|
||||
RFB protocol for authentication requires client to encrypt
|
||||
challenge sent by server with password using DES method. However,
|
||||
bits in each byte of the password are put in reverse order before
|
||||
using it as encryption key.
|
||||
"""
|
||||
newkey = list()
|
||||
for bsrc in key:
|
||||
btgt = 0
|
||||
for i in range(8):
|
||||
if bsrc & (1 << i):
|
||||
btgt = btgt | (1 << 7-i)
|
||||
newkey.append(btgt)
|
||||
super(RFBDes, self).setKey(newkey)
|
||||
Reference in New Issue
Block a user