DidiSoft .NET Library versus importing cryptographic namespaces

42 views
Skip to first unread message

Steven Ackerman

unread,
Dec 14, 2014, 9:44:26 PM12/14/14
to didisof...@googlegroups.com
Hello All,

I am a student and just finished my first programming class as part of a CS Bachelors degree program. For my final project I did made a program that simply encrypted a file and allowed the user to attach it to an email. I used the trial version of the DidiSoft OpenPGP library for .NET. I'll include the code, just for kicks. Would love to have some comments. There are some things I really struggled with, like allowing the user to choose a password. That seems more like a VB specific problem.

My real question is this. Why do I use this library instead of the importing the cryptographic names spaces? They seem similar, I am really curious. Is it because it uses openPGP? It seems like the best thing out there. Wish I could work with it more. Here's some of my code. It was way outside the scope of my project and the material we addressed in class. I really learned a lot from doing it, but someone else could have whipped this up in a flash I think. It took me many hours and lots of reading. I probably spent close to 40 hours researching this and getting it to work. Unfortunately my program will break in a few days after my trial expires! I'm still working on it anyway, not sure why.

Anyway, thanks in advance. 

Here's the code:

 Dim pgp As New PGPLib()
        ' Specify should the output be ASCII or binary
        Dim asciiArmor As Boolean = True

        REM This allows the user to choose an existing file, encrypt the file and then
        Using ofd As New OpenFileDialog With {.Filter = "Text Files (*.txt)|*.txt"}
            If ofd.ShowDialog() = DialogResult.OK Then
                Using sfd As New SaveFileDialog With {.Filter = "Text Files (*.txt)|*.pgp"}
                    If sfd.ShowDialog() = DialogResult.OK Then
                        pgp.EncryptFilePBE(New FileInfo(ofd.FileName), _
                        "password", _
                        New FileInfo(sfd.FileName), _
                        asciiArmor)
                        strEncryptedFileList = sfd.FileName
                        CryptoActions.lstFiles.Items.Add(strEncryptedFileList)
                    End If
                End Using
            End If
        End Using
        FileListTest = True

Katerina Topalova

unread,
Dec 16, 2014, 5:12:14 AM12/16/14
to didisof...@googlegroups.com
I've also used this library previously in a school project. My mentor suggested that I should transfer Excel encrypted files over SSH channel. For SSH I used this code http://sshnet.codeplex.com/ and packaged the excel books with the pgp encrypt file methods. I guess that pgp file could be created with the classes from System.Security.Cryptography namespace as I see RSA and other algorithms there, but unfortunately I had only two weeks for this project, including the documentation and this component saved me a lot of work.
Reply all
Reply to author
Forward
0 new messages