在C ++中使用加密流 [英] Using cryptographic streams in C++

查看:202
本文介绍了在C ++中使用加密流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用一些加密操作(主要是积分检查哈希表)。但是,我在查找执行这种形式的操作的文档时遇到问题:

I'd like to use some cryptographic operations (mainly integrty check hashsums). However I have problems with finding documentations of doing operations of such form:

bool read(std::istream &in) {
    hasher hv(in);
    // Do some operations on hv as if it was std::istream
    hash_type h = hv.finish ();
    hash_type h2 = read_hash(in);
    return h == h2;
}

PS。它可能是不同的库提供它a)是GPL-3兼容b)工作在GNU / Linux

PS. It may be different library provided it a) is GPL-3-compatible b) works on GNU/Linux

PPS。我不坚持crypto ++,但我想有IOStream类行为与其他C ++库的互操作性。

PPS. I don't insist on crypto++ however I would like to have IOStream-like behaviour for interoperability with other C++ libraries.

推荐答案

a href =http://spec.winprog.org/streams/ =nofollow>使用crypto ++实现您自己的istream 。

Implement your own istream using crypto++.

这篇关于在C ++中使用加密流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆