-x option encryption

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

-x option encryption

Stevew
is the  a way to automatically put the password in the startup command. 
E.G.

vi -x mypassword mynicefile.txt

This of course does not work. But is the a way to do something like this?

thanks.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5a69ee06-aafe-4a4d-9221-6e325bf184ec%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Salman Halim
This isn't what you asked, of course, but it seems problematic to me to have the password become part of your command-line history in plain text. Defeats one of the protections provided by the encryption.

--

Salman

On Sun, Jan 12, 2020, 10:24 Stevew <[hidden email]> wrote:
is the  a way to automatically put the password in the startup command. 
E.G.

vi -x mypassword mynicefile.txt

This of course does not work. But is the a way to do something like this?

thanks.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5a69ee06-aafe-4a4d-9221-6e325bf184ec%40googlegroups.com.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEdWY%3D4KMNt%2BjNxj3WgpYcfRy2L%2B0UDVY9HXRdwJ8SWjfw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Grant Taylor-2
In reply to this post by Stevew
On 1/12/20 8:24 AM, Stevew wrote:
> is the  a way to automatically put the password in the startup command.

If your goal is to open vim and work with encrypted files without the
hassle of decrypting them, there is an option.

I've installed a plugin that will automatically decrypt GPG encrypted
files on open and encrypt on write / close.  It interfaces with the GPG
agent to access the keys as necessary.

Depending on how the GPG agent is configured, if the key is in memory,
you will not be prompted for any pass phrase.

> But is the a way to do something like this?

I don't know if what I described above will do what you want or not.

> thanks.

:-)



--
Grant. . . .
unix || die

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/8e236cb9-a49c-52bc-23d0-1a98dafae6ba%40spamtrap.tnetconsulting.net.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Stevew
thanks for your responses.

I'm really just looking for a command line option as I mentioned. I didn't seem one and it appears there is none.

As far as being in memory or history.  I'm not that concerned. The files are not exactly the colonel's recipe.

Thanks.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/dd8090aa-89b0-4421-89df-56168a596f03%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Andy Wokula
Am 12.01.2020 um 21:48 schrieb Stevew:

> thanks for your responses.

>

> I'm really just looking for a command line option as I mentioned. I

> didn't seem one and it appears there is none.

>

> As far as being in memory or history.  I'm not that concerned. The

> files are not exactly the colonel's recipe.

>

> Thanks.



You can set a key with :set key=mycoolkey

This works here (doubles quotes = on Windows):



vim --cmd "set key=mycoolkey" mynicefile.txt



(needless to say this is not recommended ...)



--

Andy

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5E1CA765.40604%40yahoo.de.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Grant Taylor-2
On 1/13/20 10:22 AM, 'Andy Wokula' via vim_use wrote:
> You can set a key with :set key=mycoolkey

Interesting.

> This works here (doubles quotes = on Windows):
>
> vim --cmd "set key=mycoolkey" mynicefile.txt

I wonder if it would be possible to play with other methods to populate
the "mycoolkey" text.  Admittedly, they aren't as Windows friendly.

Environment variables are the first thing that comes to mind.

After that is file redirection, possibly from a sub-command.

Finally, a full sub-command that extracts the password out of something,
possibly GPG protected file.  }:-)

> (needless to say this is not recommended ...)

I know that the typical gotchas are the output of ps (et al.) and
methods to access other processes environment variables.  What other
concerns are there that my uncaffeinated brain is missing?



--
Grant. . . .
unix || die

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/61f70749-65e2-5066-de17-a1f6db20abf6%40spamtrap.tnetconsulting.net.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Tim Chase
On 2020-01-13 11:16, 'Grant Taylor' via vim_use wrote:

> On 1/13/20 10:22 AM, 'Andy Wokula' via vim_use wrote:
> > You can set a key with :set key=mycoolkey  
>
> Interesting.
>
> > This works here (doubles quotes = on Windows):
> >
> > vim --cmd "set key=mycoolkey" mynicefile.txt  
>
> I wonder if it would be possible to play with other methods to
> populate the "mycoolkey" text.  Admittedly, they aren't as Windows
> friendly.
>
> Environment variables are the first thing that comes to mind.

Did a quick test:

  $ vim delme.txt
  [add some text]
  :set key=secret
  :wq
  $ KEY="$(echo secret)" vim +'let &key=$KEY | e delme.txt

which lets you use any method you want to obtain the secret key
(using the super-secure "echo" method of password storage here)

Alternatively, you could obtain the key without the environment
variable, though note that the trailing newline becomes part of the
password:

  $ echo secret > password.txt
  $ vim delme.txt
  [add some text]
  :let &key=system('cat password.txt")
  :wq
  $ vim +'let &key=system("cat password.txt") | e delme.txt'

where you can use whatever program you want in place of

  "cat password.txt"

to obtain your password.

-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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200113124530.5704d98f%40bigbox.attlocal.net.
Reply | Threaded
Open this post in threaded view
|

Re: -x option encryption

Stevew
In reply to this post by Andy Wokula
Hey andy that works .
Thanks. 

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/2065b557-4710-4e05-a4b9-56cbd1cdb4b6%40googlegroups.com.