OpenSSL and what encryption method to use

254

You need to pay attention to this points while crypting anything:

● Confidentiality
● Integrity
● Authenticity
● Non-repudiation
● Access control
● Difficulty compromise

Taking this as the base you shoud choose the method wich helps you the most. (Being an Asymetric cypher a great way of accommplish a lot of the above.[Use a private and a public key..])

Also Here's the GPG QuickStart Guide.

In the symetric ways there is AES(128, 192, 256 bits) and DES(64 bit per block)

Check this part of this OpenSSL Manual

As someone says above using GPG is a great Idea beacuse of the use of Assymetric Keys which is always safer than just Passwords in any access...

To get a list of Cipher methos you can use:

openssl list-cipher-commands

So for example an AES Cipher:

openssl enc -aes-256-cbc -salt -in file.txt -out file.enc

And to decrypt

openssl enc -d -aes-256-cbc -a -in file.enc

Still, you may have occasion to want to encrypt a file without having to build or use a key/certificate structure.

In the link there is the How do I base64-encode something? part and the How do I simply encrypt a file? part. Hope this can help you

For more info Dive onto Asymmetric key techniques and Symmetric-key

Here's the RFC for Determining Strengths For Public Keys Used For Exchanging Symmetric Keys

Hope this helps. Remember Always to read the manual of what you use.

Share:
254

Related videos on Youtube

Akash Yadav
Author by

Akash Yadav

Updated on September 18, 2022

Comments

  • Akash Yadav
    Akash Yadav over 1 year

    I am trying to get value of some publicly declared userform variable into other module written in other sheets.

    first myform.show function initialize the form and set i = 0. But when I closed the form using x button and used the queryclosed function to update the value of i and control return to Myform.val = 10 line then userform_initialize() function is again called and the condition becomes false becoze it again set the i to 0. I don't know why this is happening. Any help please.

    my sheet module code is as follows:

    Sub myModule()
        Myform.Show
        If Myform.val=10 then
            msg "Hi"
        End if
    End sub
    

    and Myform code is as follows:

    Public i as integer
    
    Private Sub UserForm_Initialize()        
        i = 0
    End sub
    
    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
        If CloseMode <> 1 Then
            i = 10
        End If
    End Sub
    

    I want the above if condtion to be true if form is closed using x button and false if form is closed using commandbutton.

    • Celada
      Celada about 11 years
      For encrypting files most conveniently, GPG would definitely be recommended over OpenSSL.
    • Celada
      Celada about 11 years
      Also, the second argument to openssl is not an "encryption type" but a subcommand, to tell it what kind of action to take. For example, manupulation of X.509 certificates, manipulation of keys, signing, encryption, certificate generation, message digest calculation, etc...
    • Zoredache
      Zoredache about 11 years
      Go with AES. It is widely supported.
    • HikeMike
      HikeMike about 11 years
      @Zoredache There are 18 AES options offered by openssl enc: cbc, cfb, cfb1, cfb8, ecb and ofb, each in 128/192/256 bit.
  • Jasmine
    Jasmine about 11 years
    That is a great link. Reading it. When you run something like: openssl passwd -1 MySecret how do you take the resulting hash and get back the face you entered MySecret to begin with?
  • AAlvz
    AAlvz about 11 years
    Normally its showed after you create the cypher. It is showed right after finishing the command. Check out this page. Has some usefull tips about the hash you say. And A Certificate looks like this if you open it when created..
  • Jasmine
    Jasmine about 11 years
    Maybe I am still confused. If I have a txt file that contains a bunch of passwords and I want to replace the plan text passwords in the sheet with shadow style pasword so if someone get their hands on my sheet they dont just get plain text passwords. I would run something like the command in my first comment and get the result. I paste that result in my password sheet where the plain text password was. Later I want to know what the password for something is and I just have that shadow style string. How to I decrypt that so I know what my actual password is?
  • AAlvz
    AAlvz about 11 years
    I think you are a little confused on the way that keys work... it would be unsafe to be able to decrypt any message, don't you think? .. thats why you must have the private and public key... but if you really need to be able to decrypt make sure you use a secure password, and check the gpg crypt method gpg -c myfile. I think this is what you want and will solve the problem you say
  • JvdV
    JvdV almost 5 years
    Dim MyFormInstance As MyForm? This is new to me, please link me to the documentation on this. I'm curious.
  • Sam
    Sam almost 5 years
    @JvdV, a form is in many aspects identical to a class module. Not documentation, but still useful
  • T.M.
    T.M. almost 5 years
    @JvdV … a UserForm is nothing other than a class and you can/should use it as such (instead of referencing the default instance); you might get some references at Destroy a modeless Userform instance properly
  • Akash Yadav
    Akash Yadav almost 5 years
    @ Hi sam first of All vary thanks a lot , your answer solve the problem. i did not do much changes just add cancel =1 and me.hide line in query response function just like yours and its working fine just like i want . second i just check the if statement in given problem was wrong.in if condition instead of myform.val it was myform.i...but anyhow you solve it..thanks....but still i dont know why myform.i in my original code is calling the userform_initialize function...if you can point out the reason it will be helpful..
  • Sam
    Sam almost 5 years
    When you closed the form, the variable holding it was reset. Since you used implicit instantiation, it was created from scratch again. When you changed to .Hide, all that changed. The variable is never reset, and you have it all available.