Python+OTR使用otrxmppchannel,无法发送消息

2024-09-29 18:46:35 发布

您现在位置:Python中文网/ 问答频道 /正文

有人能帮我用Python发送OTR加密的消息吗?在

我试过here的指令,但没有成功。在

我目前的计划是:

import os
import time
from otrxmppchannel import OTRXMPPChannel

privkey = open('mykey.otrprivkey', 'r').read()

channel = OTRXMPPChannel('sender@jappix.com','password_of_sender','recepient@blabla.com',privkey)

channel.send('')  # Force OTR setup
time.sleep(3)  # Wait a bit for OTR setup to complete
channel.send('This message should be encrypted')

文件呢我的钥匙.otrprivkey是包含私钥的文件,其格式为:

^{2}$

作为密钥文件,我尝试了以下格式的文件:

(privkeys
 (account
(name "senderv@jappix.com")
(protocol prpl-jabber)
(private-key 
 (dsa 
  (p ....

但那不管用。在


Tags: 文件importcomsend消息time格式setup

热门问题