Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Cryptography

Moderators: larsivi kris

Posted: 12/04/07 15:59:41 Modified: 12/04/07 16:01:01

Hi,

the manual says something about cryptography, but I can't find any cryptography functionality in Tango, only digests (or whatever it is called). Is there such thing? If not, please help me with few directions how to implement it myself. I need to serve encrypted HTTP stream. Like blowfish or something. I know blowfish is not a stream cipher, but it is the only source I found in the D's NG. So I need a server that serves encoded files, and a client that downloads the files and decodes them. They easy way (which I already got working) is to encrypt the whole file, send it to the client, the client downloads the whole piece and decodes it with the key. But my needs include streaming audio and video. And while waiting for the whole download is not so bad for few megs audio files, a few hundred megs video needs a streaming for sure. So please give me few guide lines how to do this with Tango (maybe implementing a Stream class or something?).

And by the way, what is the status of zip vfs? I read somewhere it is being worked on.

thanks, bobef

Author Message

Posted: 12/06/07 10:29:43

added dwin.io.crypt.Base64 to svn todaddy

Posted: 12/06/07 11:02:41

Yes, you are right, we've had bigger ambitions on the cryptography front than we've been able to fulfill. We hope to improve on this soon though, as there is some at least half-way compatible code around.

Base64 will be added too, although it strictly speaking isn't cryptography, more just an encoding.

For implementing such algos, a stream implementation would generally be the best, but not everything fits into that category. This doesn't mean that Tango don't want it though, and some algorithms are adaptable for stream use later on. I would look at tango.io.digest for some suggestions on relevant interfaces, and also tango.io.stream.DigestStream? for tips on stream implementations.

vfs.zip should be in the next release for reading zip files, I don't think writing them is ready yet.

Posted: 07/11/08 07:04:50

Have you considered LibTomCrypt?? It's written in C so it should be easily linked against D.

http://libtomcrypt.com/features.html

Posted: 09/19/08 11:30:06

I have written bindings against cryptoeay32-0.9.8.dll and ssleay32-0.9.8.dll, although not complete. The loader code is stolen from tango.net.C.OpenSSL, if that is of any interest.

Ciao

Tom