--- src/filed/backup.c Mon Nov 15 17:43:33 2004 +++ /home/dan/src/backup.c Sun Nov 21 17:42:08 2004 @@ -30,6 +30,12 @@ #include "bacula.h" #include "filed.h" +#define ENCRYPT 1 + +#ifdef ENCRYPT +bool bencrypt(Bytef *dest, uLong sourceLen); +#endif + #ifdef HAVE_ACL #include #include @@ -460,6 +466,11 @@ } #endif +#ifdef ENCRYPT + /* encrypt the block */ + bencrypt((Bytef *)sd->msg, sd->msglen); +#endif + /* Send the buffer to the Storage daemon */ if (!sparseBlock) { if (ff_pkt->flags & FO_SPARSE) { @@ -597,3 +608,15 @@ } return 1; } + +#ifdef ENCRYPT +bool bencrypt(Bytef *dest, uLong sourceLen) { + Bytef *i; + + for (i = dest; i < (dest + sourceLen); i++) { + *i = *i ^ 170; + } + + return 1; +} +#endif