Hi Allen,

for OpenSG 2.0 I would like to add the boost iostreams library http://www.boost.org/libs/iostreams/doc/index.html With this library it is really easy to add different compression or encryption filters.

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/filtering_stream.hpp>

namespace io = boost::iostreams;

int main()
{
    io::filtering_ostream out;
    out.push(compressor());
    out.push(base64_encoder());
    out.push(file_sink("my_file.txt"));
    // write to out using std::ostream interface
}

------

#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filtering_stream.hpp>

namespace io = boost::iostreams;

int main()
{
    io::filtering_istream in;
    in.push(decompressor());
    in.push(base64_decoder());
    in.push(file_source("my_file.txt"));
    // read from in using std::istream interface
}

In OpenSG 1.6.0 the gzip stream is hardcoded so extending this is not easy. But I think I will add a read and write callback into the SceneFileHandler class.

void setReadCB(readcbfp fp);
void setWriteCB(writecbfp fp);

If you set this callback functions you can implement your own reading and writing stuff for example using the boost iostream lib.

Andreas

I hadn't really given much thought to using another compression library.

If OpenSG was going to add support for something beyond zlib, what about supporting 7zip (http://www.7-zip.org)? It seems to get the best compression ratios out there and it supports ZIP, CAV, RAR, ARJ, gzip, bzip2, tar, cpio, rpm, and deb. (in other words it would give us a lot of options)

I don't fully understand how the current compression stream stuff in OpenSG works, but could someone that does comment on how hard it would be to add support for a new type of compressed stream? Does the OpenSG load/save system allow for arbitrary piping of file stream modifiers/loaders or how does this work?

-Allen

Antonio Bleile wrote:

Hi Allen,

I recently ran into a similar problem. I had to
deploy an application via internet containing
a zip archive which I had to deflate on the client side (programmatically). I found this very useful zip/unzip api:

http://www.winimage.com/zLibDll/minizip.html

I haven't used the crypting features, but I saw
that it is somehow supported. It might be
useful for you as well.

Regards,

 Toni


-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:opensg-users-
[EMAIL PROTECTED] Per conto di Allen Bierbaum
Inviato: venerdì 11 novembre 2005 15.24
A: opensg-users
Oggetto: [Opensg-users] Encryption of loaded files

I need a simple fast way to ship data files with an application in such
a way that they can only be loaded with that application.

I know that it is possible to load gzip compressed files with OpenSG,
but has anyone ever done anything with supporting encrypted files?

I am not asking for anything too complex here, even just support for a
file stream modifier that XOR'ed a user defined key against all the
bytes coming through would work well enough for me.

-Allen


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to