• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.run_cipher函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中shadowsocks.crypto.util.run_cipher函数的典型用法代码示例。如果您正苦于以下问题:Python run_cipher函数的具体用法?Python run_cipher怎么用?Python run_cipher使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了run_cipher函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test

def test():
    from shadowsocks.crypto import util

    cipher = Salsa20Cipher(b'salsa20-ctr', b'k' * 32, b'i' * 8, 1)
    decipher = Salsa20Cipher(b'salsa20-ctr', b'k' * 32, b'i' * 8, 1)

    util.run_cipher(cipher, decipher)
开发者ID:03013405yujiangfeng,项目名称:XX-Net,代码行数:7,代码来源:salsa20_ctr.py


示例2: test_chacha20

def test_chacha20():
    from shadowsocks.crypto import util

    cipher = Salsa20Crypto(b'chacha20', b'k' * 32, b'i' * 16, 1)
    decipher = Salsa20Crypto(b'chacha20', b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:qbektrix,项目名称:shadowsocks,代码行数:7,代码来源:ctypes_libsodium.py


示例3: test

def test():
    from shadowsocks.crypto import util

    cipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 1)
    decipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Mrlantian,项目名称:Pigeon,代码行数:7,代码来源:rc4_md5.py


示例4: run_method

def run_method(method):
    from shadowsocks.crypto import util

    cipher = CtypesCrypto(method, b'k' * 32, b'i' * 16, 1)
    decipher = CtypesCrypto(method, b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Yggdroot,项目名称:shadowsocks,代码行数:7,代码来源:ctypes_openssl.py


示例5: run_method

def run_method(method):

    print(method, ': [stream]', 32)
    cipher = OpenSSLStreamCrypto(method, b'k' * 32, b'i' * 16, 1)
    decipher = OpenSSLStreamCrypto(method, b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Friday21,项目名称:shadowsocks,代码行数:7,代码来源:openssl.py


示例6: test_chacha20_ietf

def test_chacha20_ietf():

    print("Test chacha20-ietf")
    cipher = SodiumCrypto('chacha20-ietf', b'k' * 32, b'i' * 16, 1)
    decipher = SodiumCrypto('chacha20-ietf', b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:ShawnZee,项目名称:shadowsocks,代码行数:7,代码来源:sodium.py


示例7: test_salsa20

def test_salsa20():

    print("Test salsa20")
    cipher = SodiumCrypto('salsa20', b'k' * 32, b'i' * 16, 1)
    decipher = SodiumCrypto('salsa20', b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:ShawnZee,项目名称:shadowsocks,代码行数:7,代码来源:sodium.py


示例8: test_encryption

def test_encryption():
    from shadowsocks.crypto import util

    cipher = TableCipher('table', b'test', b'', 1)
    decipher = TableCipher('table', b'test', b'', 0)

    util.run_cipher(cipher, decipher)
开发者ID:Mrlantian,项目名称:Pigeon,代码行数:7,代码来源:table.py


示例9: test_aes_256_gcm

def test_aes_256_gcm():
    print("Test sodium:aes-256-gcm [payload][tag]")
    cipher = SodiumAeadCrypto('sodium:aes-256-gcm',
                              b'k' * 32, b'i' * 32, 1)
    decipher = SodiumAeadCrypto('sodium:aes-256-gcm',
                                b'k' * 32, b'i' * 32, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:8,代码来源:sodium.py


示例10: test_chacha20_ietf_poly1305

def test_chacha20_ietf_poly1305():
    print("Test chacha20-ietf-poly1305 [payload][tag]")
    cipher = SodiumAeadCrypto('chacha20-ietf-poly1305',
                              b'k' * 32, b'i' * 32, 1)
    decipher = SodiumAeadCrypto('chacha20-ietf-poly1305',
                                b'k' * 32, b'i' * 32, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:8,代码来源:sodium.py


示例11: run_method

def run_method(method):
    from shadowsocks.crypto import openssl

    print(method, ': [stream]', 32)
    cipher = MbedTLSStreamCrypto(method, b'k' * 32, b'i' * 16, 1)
    decipher = openssl.OpenSSLStreamCrypto(method, b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Crippio,项目名称:shadowsocks,代码行数:8,代码来源:mbedtls.py


示例12: test_chacha20_ietf_poly1305_chunk

def test_chacha20_ietf_poly1305_chunk():
    print("Test chacha20-ietf-poly1305 chunk [size][tag][payload][tag]")
    cipher = SodiumAeadCrypto('chacha20-ietf-poly1305',
                              b'k' * 32, b'i' * 32, 1)
    decipher = SodiumAeadCrypto('chacha20-ietf-poly1305',
                                b'k' * 32, b'i' * 32, 0)

    cipher.encrypt_once = cipher.encrypt
    decipher.decrypt_once = decipher.decrypt

    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:11,代码来源:sodium.py


示例13: test_aes_256_gcm_chunk

def test_aes_256_gcm_chunk():
    print("Test sodium:aes-256-gcm chunk [size][tag][payload][tag]")
    cipher = SodiumAeadCrypto('sodium:aes-256-gcm',
                              b'k' * 32, b'i' * 32, 1)
    decipher = SodiumAeadCrypto('sodium:aes-256-gcm',
                                b'k' * 32, b'i' * 32, 0)

    cipher.encrypt_once = cipher.encrypt
    decipher.decrypt_once = decipher.decrypt

    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:11,代码来源:sodium.py


示例14: run_aead_method

def run_aead_method(method, key_len=16):

    print(method, ': [payload][tag]', key_len)
    key_len = int(key_len)
    cipher = MbedTLSAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = MbedTLSAeadCrypto(
        method,
        b'k' * key_len, b'i' * key_len, 0
    )

    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:11,代码来源:mbedtls.py


示例15: run_aead_method

def run_aead_method(method, key_len=16):
    from shadowsocks.crypto import openssl

    print(method, ': [payload][tag]', key_len)
    key_len = int(key_len)
    cipher = MbedTLSAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = openssl.OpenSSLAeadCrypto(
        method,
        b'k' * key_len, b'i' * key_len, 0
    )

    util.run_cipher(cipher, decipher)
开发者ID:Crippio,项目名称:shadowsocks,代码行数:12,代码来源:mbedtls.py


示例16: run_aead_method_chunk

def run_aead_method_chunk(method, key_len=16):

    print(method, ': chunk([size][tag][payload][tag]', key_len)
    key_len = int(key_len)
    cipher = MbedTLSAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = MbedTLSAeadCrypto(
        method,
        b'k' * key_len, b'i' * key_len, 0
    )

    cipher.encrypt_once = cipher.encrypt
    decipher.decrypt_once = decipher.decrypt
    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:13,代码来源:mbedtls.py


示例17: run_aead_method

def run_aead_method(method, key_len=16):

    print(method, ': [payload][tag]', key_len)
    cipher = libcrypto.EVP_get_cipherbyname(common.to_bytes(method))
    if not cipher:
        cipher = load_cipher(common.to_bytes(method))
    if not cipher:
        print('cipher not avaiable, please upgrade openssl')
        return
    key_len = int(key_len)
    cipher = OpenSSLAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = OpenSSLAeadCrypto(method, b'k' * key_len, b'i' * key_len, 0)

    util.run_cipher(cipher, decipher)
开发者ID:Friday21,项目名称:shadowsocks,代码行数:14,代码来源:openssl.py


示例18: run_aead_method_chunk

def run_aead_method_chunk(method, key_len=16):
    from shadowsocks.crypto import openssl

    print(method, ': chunk([size][tag][payload][tag]', key_len)
    key_len = int(key_len)
    cipher = MbedTLSAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = openssl.OpenSSLAeadCrypto(
        method,
        b'k' * key_len, b'i' * key_len, 0
    )

    cipher.encrypt_once = cipher.encrypt
    decipher.decrypt_once = decipher.decrypt
    util.run_cipher(cipher, decipher)
开发者ID:Crippio,项目名称:shadowsocks,代码行数:14,代码来源:mbedtls.py


示例19: run_aead_method_chunk

def run_aead_method_chunk(method, key_len=16):

    if not loaded:
        load_openssl(None)
    print(method, ': chunk([size][tag][payload][tag]', key_len)
    cipher = libcrypto.EVP_get_cipherbyname(common.to_bytes(method))
    if not cipher:
        cipher = load_cipher(common.to_bytes(method))
    if not cipher:
        print('cipher not avaiable, please upgrade openssl')
        return
    key_len = int(key_len)
    cipher = OpenSSLAeadCrypto(method, b'k' * key_len, b'i' * key_len, 1)
    decipher = OpenSSLAeadCrypto(method, b'k' * key_len, b'i' * key_len, 0)

    cipher.encrypt_once = cipher.encrypt
    decipher.decrypt_once = decipher.decrypt
    util.run_cipher(cipher, decipher)
开发者ID:Cloud0219,项目名称:shadowsocks,代码行数:18,代码来源:openssl.py


示例20: run_method

def run_method(method):

    cipher = OpenSSLCrypto(method, b'k' * 32, b'i' * 16, 1)
    decipher = OpenSSLCrypto(method, b'k' * 32, b'i' * 16, 0)

    util.run_cipher(cipher, decipher)
开发者ID:00o0o,项目名称:shadowsocks-1,代码行数:6,代码来源:openssl.py



注:本文中的shadowsocks.crypto.util.run_cipher函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python encrypt.encrypt_all函数代码示例发布时间:2022-05-27
下一篇:
Python common.to_str函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap