zoukankan      html  css  js  c++  java
  • ZeroMQ接口函数之 :zmq_z85_encode – 使用Z85算法对一个二进制秘钥进行加密,输出可打印的文本

    ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq-z85-encode

    zmq_z85_encode(3)          ØMQ Manual - ØMQ/4.1.0

    Name

    zmq_z85_encode – 使用Z85算法对一个二进制秘钥进行加密,输出可打印的文本

    Synopsis

    char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);

    Description

    zmq_z85_encode()函数会对data参数和size参数指定的二进制数据块进行加密,并以字符串形式存储在dest参数指定的空间内。这个二进制数据块的大小必须是可以被4整除的。dest参数指定的空间大小至少满足size * 1.25 + 1,最后1个字节用来存储字符串结束符。一个32B长的密码会被加密后会变成40B长再加1B的空字符。

    加密方式遵循ZMQ RFC 32 规格。

    Return value

    如果zmq_z85_encode()函数执行成功,则会返回dest的指针,否则返回NULL。

    Example

      加密一个curve密码

    1 #include <sodium.h>
    2 uint8_t public_key [32];
    3 uint8_t secret_key [32];
    4 int rc = crypto_box_keypair (public_key, secret_key);
    5 assert (rc == 0);
    6 char encoded [41];
    7 zmq_z85_encode (encoded, public_key, 32); puts (encoded);

    See also

    zmq_z85_decode(3)  zmq_curve_keypair(3)  zmq_curve(7)

    Authors

    This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.

    Web site design and content is copyright (c) 2007-2012 iMatix Corporation. Contact us for professional support. Site content licensed under the Creative Commons Attribution-Share Alike 3.0 License. ØMQ is copyright (c) Copyright (c) 2007-2012 iMatix Corporation and Contributors. ØMQ is free software licensed under the LGPL. ØMQ, ZeroMQ, and 0MQ are trademarks of iMatix Corporation. Terms of Use — Privacy

    Policy

     

    更多 ZeroMQ APIhttp://www.cnblogs.com/fengbohello/p/4230135.html

     

    翻译:风波

    mail : fengbohello@qq.com

     

  • 相关阅读:
    python3文件操作
    python3复习
    python3集合
    python购物车
    python小知识点总结
    python-review01
    python字典
    04day->python列表和元祖
    python字符串操作
    《令人拍案称奇的Mask RCNN》
  • 原文地址:https://www.cnblogs.com/fengbohello/p/4243961.html
Copyright © 2011-2022 走看看