From 40e6a71c6777242a254f1748766aa0e60764ebb3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 16 May 2010 22:32:54 +0200 Subject: Add the blowfish encryption patch from Mohsin Ahmed. Needs more work. --- runtime/doc/editing.txt | 5 +++++ runtime/doc/options.txt | 15 ++++++++++++++- runtime/doc/todo.txt | 13 +++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 87e859f72..98d4d633e 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1361,6 +1361,11 @@ the file is encrypted. To disable the encryption, reset the 'key' option to an empty value: > :set key= +You can use the 'cryptmethod' option to select the type of encryption. Do +this before writing the file. When reading an encrypted file it will be set +automatically to the method used when that file was written. You can change +'cryptmethod' before writing that file to change the method. + When reading a file that has been encrypted and this option is not empty, it will be used for decryption. If the value is empty, you will be prompted to enter the key. If you don't enter a key, the file is edited without being diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index f1785bb85..da0ef5bf9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2049,6 +2049,19 @@ A jump table for the options with a short description can be found at |Q_op|. with system specific functions. + *'cryptmethod'* *'cm'* +'cryptmethod' number (default 0) + local to buffer + {not in Vi} + Method used for encryption when the buffer is written to a file: + 0 PkZip compatible method. A weak kind of encryption. + backwards compatible with Vim 7.2 and older. + 1 Blowfish method. Strong encryption. Not compatible + with Vim 7.2 and older. + When reading an encrypted file 'cryptmethod' will be set automatically + to detected method for the file being read. + + *'cscopepathcomp'* *'cspc'* 'cscopepathcomp' 'cspc' number (default 0) global @@ -4141,7 +4154,7 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer {not in Vi} The key that is used for encrypting and decrypting the current buffer. - See |encryption|. + See |encryption| and 'cryptmethod'. Careful: Do not set the key value by hand, someone might see the typed key. Use the |:X| command. But you can make 'key' empty: > :set key= diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 48a19c9b1..fcb6b0c0c 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -30,6 +30,17 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- +check blowfish.c +check sha256.c +Use 'cm' option only when FEAT_CRYPT is defined. +When not full match with magic, check for head and give warning about +unsupported crypt method. +if 'enc' is ucs-2, does utf-8 to ucs-2 encoding always work for seed? + +Crypt update: +- move bf_self_test() and sha256_self_test() elsewhere +- Update E000 to error number. + Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6) E315 when trying to change a file in FileChangedRO autocommand event. @@ -1082,8 +1093,6 @@ restored. (Luc St-Louis) Vim 7.3: Patches to include: -- Add patch for 'relativenumber' option? Markus Heidelberg, 2008 Jun 27. - Update 2010 May 2. - Add blowfish encryption. Openssl has an implementation. Also by Paul Kocher (LGPL), close to original. Mohsin also has some ideas. Take four bytes and turn them into unsigned to avoid byte-order problems. -- cgit v1.2.3