On 04/20/2011 01:50 AM, Mathew Brown wrote:
Thanks a lot. I'll give it a try and hopefully can retrieve the file
again :)
$ for key in $(cat keys); do vim blowfish.txt --cmd "set key=$key"\
-c ":set key= | saveas $key | q"; done
Just as a caveat, this will expose your passwords in the
process-list and on the hard-drive in the file-names. If you're
the only user of the system, I'd not be overly concerned. If you
share the system with other concurrent users, I'd try to tweak it
to be pure vim:
vi -o keys.txt encrypted.txt
and then in the 'keys.txt' file, execute the following:
let i=0|g/^/let i+=1|let key=getline('.')|wincmd b|let
&key=key|e|let &key=''|exec 'w '.i|wincmd t
(this assumes that the auto-split puts keys.txt in the top window
and encrypted.txt in the bottom window...if they appear the other
way around, swap the "wincmd" commands for top/bottom)
This will produce files on your drive named "1" through the
number of lines in keys.txt which will be the index of the
password. You can then use Erik's "file" command to determine
which index contains the ASCII data. This should keep things
less exposed.
-tim
--
You received this message from the "vim_use" 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