Loading ...
Sorry, an error occurred while loading the content.

57158patch for encryption, strengthened key with salt.

Expand Messages
  • Mosh
    May 30 4:39 PM
      Attaching patch7.zip encryption Key_strengthening

      Changes:
      1 added 8 bytes salt to file header,
      2. sha256_key takes password, salt, salt_len (salt is binary, not
      null terminated)
      3. sha256_seed also generates salt along with iv.
      4. bf_key_init takes password and salt.
      5. bf_key_init converts ascii hex key[64] to binary key[32] (this
      change is independent of the 1..4 above)

      Also attached is vc-proj.zip (contains dsp and dsw project files).
      The HG repository didn't have these files, so I copied them from older
      older source tree.
      Might be useful to others on this list using vc++ on windows to debug.

      thanks
      mohsin.

      ===
      Changes are to these functions:

      -char_u *sha256_key __ARGS((char_u *buf));
      +char_u *sha256_key __ARGS((char_u *buf, char_u *salt, int salt_len));
      -void sha2_seed __ARGS((char_u header[], int header_len));
      +void sha2_seed __ARGS((char_u header[], int header_len, char_u
      salt[], int salt_len));
      -void bf_key_init __ARGS((char_u *password));
      +void bf_key_init __ARGS((char_u *password, char_u *salt, int salt_len));

      ====
      Archive: patch7.zip
      Length Method Size Cmpr Date Time CRC-32 Name
      -------- ------ ------- ---- ---------- ----- -------- ----
      0 Stored 0 0% 05-30-2010 16:18 00000000 patch7/
      22403 Defl:N 9436 58% 05-30-2010 16:15 c5f05ce7 patch7/blowfish.c
      269 Defl:N 149 45% 05-30-2010 14:35 7550dad0 patch7/blowfish.pro
      259837 Defl:N 74612 71% 05-30-2010 16:04 135cabf3 patch7/fileio.c
      14976 Defl:N 2044 86% 05-22-2010 18:19 fc01209c patch7/Make_ivc.dsp
      534 Defl:N 208 61% 03-15-2010 19:16 c76b6155 patch7/Make_ivc.dsw
      12513 Defl:N 3947 69% 05-30-2010 16:04 579b33d9 patch7/sha256.c
      437 Defl:N 208 52% 05-30-2010 15:06 338b6d4c patch7/sha256.pro
      9905 Defl:N 3109 69% 05-30-2010 16:17 23c0e6bd
      patch7/udiff-73hg-73hgm2.diff
      -------- ------- --- -------
      320874 93713 71% 9 files



      ====
      Archive: vc-proj.zip
      Length Method Size Cmpr Date Time CRC-32 Name
      -------- ------ ------- ---- ---------- ----- -------- ----
      14976 Defl:N 2044 86% 05-22-2010 18:19 fc01209c patch7/Make_ivc.dsp
      534 Defl:N 208 61% 03-15-2010 19:16 c76b6155 patch7/Make_ivc.dsw
      -------- ------- --- -------
      15510 2252 86% 2 files



      On Wed, May 26, 2010 at 1:50 AM, Bram Moolenaar <Bram@...> wrote:
      >
      > Mohsin wrote:
      >
      >> So I downloaded the source with hg, and built gvimd.exe with VC++.
      >>
      >> I see that vim only writes encrypted file with VimCrypt~01 version (I
      >> am looking at fileio.c)
      >> how do I get it to use VimCrypt~02 for writing new files.
      >
      >        :set cryptmethod=1
      >
      > Currently the default is still 0, to avoid people creating files they
      > can't uncrypt on another system.  I'm not sure when the default can be
      > 1.  Perhaps only in Vim 7.4.
      >
      >> I have another minor patch ready for
      >> http://en.wikipedia.org/wiki/Key_strengthening
      >> which I need to test a bit.
      >
      > OK, please send me a patch against the mercurial repository when you are
      > ready.
      >
      >> Minor build fix for vc++ was to comment out this line,
      >>   netbeans.c:369   // sock_errno =3D EINTR;  // sock_errno is a function
      >> (not an l-value) in win32.
      >
      > That was fixed, please "hg pull".
      >
      >
      > --
      > From "know your smileys":
      >  <|-) Chinese
      >  <|-( Chinese and doesn't like these kind of jokes
      >
      >  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
      > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      > \\\        download, build and distribute -- http://www.A-A-P.org        ///
      >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
      >

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 9 messages in this topic