|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
vba text encryption method...
Ok guys & gals... I'm wanting a way to encrypt text to be sent in an email with vba, working on a small semi secure program for work, any ideas or suggestions? I've tried googling it but have had limited results... I have a method that I have written now, but I'd like to see others out there if possible...
Any suggestions welcome ![]() |
|
#2
|
|||
|
|||
|
If I were working on a project of this sort I would write a DLL wrapping the funtionality of GnuPG.
For those that do not know what PGP or GnuPG is here goes: PGP was created as a facility to encrypt and decrypt text. It uses a public and private key. The private key is for the owner of the message to keep safe and private. The public key is the one that you give out to anyone you would like to view your messages. This kep ensures that you are the true sender of the message. PGP ensures that a message or private key cannot be derived from the public key in any reasonable fashion. GnuPG is the opensource clone (sort of) of PGP. http://www.gnupg.org/ If you google long enough you may find that someone has already written a wrapper in your language of choice. I've noticed wrappers / libraries for Python and C# thus far.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
||||
|
||||
|
Thanks for the suggestion wil, I'll see what I can find for vba... that's the only language that I have available at work (sadly enough
) |
|
#4
|
|||
|
|||
|
Re: vba text encryption method...
Quote:
Suggestion: 01. Represen data in a matrix format. For example, your message is " Hello there." | H E L L | | O T H | | E R E . | Transform the content (Row to colums) So, above matrix will become: | H O E | | E R | | L T E | | L H . | Now transmit this data. 02. Now convert this data at receipent end. 03. Above is the basic algorithm, now you can implement key using XOR to add extra complexity. Thank You. |
|
#5
|
|||
|
|||
|
Another suggestion is to write something like this:
First determine a maximum fixed message length. This should be a high number as you need to think about what the longest message might be. For simplicity in this example lets use 20 characters. 1. Find length of message 2. Attach length to end of message string 3. Left Pad the string with a character of your choice forcing the length to exactly the number of the max characters you chose. Example: mystring = "test message" mystring = "test message12" mystring = "********test message12" ( now, of course the string length is maxlength + 2 ) You also want to pad your numbers in case the length is something like 6, you would take on 06 to the end of the string as opposed to 6. Now scramble the message using any variation you can come up with. ( descrambling is easy... just scramble them with your same algorithm backwards... just don't do too many iterations or you will get confused ). Now do a simple base64 encryption on the string... you can find a vb module for this on the net. I'd suggest you open Visual basic, add the module to the project, then compile as DLL to use it in your vba project. If you can't find this module let me know and I will send it to you. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > vba text encryption method... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|