移动下位置
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run

This commit is contained in:
2024-07-31 16:28:52 +08:00
parent 29b3196b9a
commit 86123c3358
8 changed files with 0 additions and 0 deletions

View 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)