in reply to Re: Encrypting a Filename
in thread Encrypting a Filename

Because the backup process compares current files against the backup, and only copies newer files. Given changed file X, it needs to know to look at remote file Y to see if it's older.

Replies are listed 'Best First'.
Re: Re: Re: Encrypting a Filename
by petdance (Parson) on Jun 15, 2001 at 20:52 UTC
    So take note of the timestamp on secretfile.dat, tar it up, and then set the timestampe on the tar to that timestamp.

    If your entire tree is done with this tar mechanism, then the backup process should work fine.

    xoxo,
    Andy

    %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
    'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
    "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >
    
      The timestamp is not the problem. The timestamp on the tar will naturally work just as well, anyway, without having to reset it. The problem is with the filename. If it is not 1-to-1, then it will have to open the file to check the original file name, to be sure it has the right one.

      —John

        So give the tar the one-way crypted version of the real filename. As in, roughly:
        my $timestamp = timestamp_of( $innerfile ); my $tarname = crypt( $innerfile, $innerfile ) . ".tar"; $tarname = substr( $tarname, 2 ); system( 'tar $tarname cvf $innerfile' ); touch( $tar, $timestamp );
        The crypted filename will always be the same thing. So foo.txt will always create the same .tar file.

        Also, you'll want to drop the first 2 chars of the crypted filename, because they are the salt, which in this case is the first two letters of the inner filename.

        xoxo,
        Andy

        %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
        'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
        "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >