Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypted strokes

Status
Not open for further replies.

3wsparky

IS-IT--Management
May 25, 2003
121
0
0
GB
Is there an application where a user could fireup outlook new email and then press a key combo eg. CTRL & E for example to have the keystrokes typed encrypted on the fly and then CTRL & U to return to unencrypted mode to resume application typing as normal ?

would be useful for sending confidential email or messages or even just writing up notes to be saved in what could be an unsecure location.
 
Well, you could create your own email input form in VB and use the advapi32.dll to encrypt the input.

I saw some examples here before. Do a search in this forum using:
advapi32 CryptEncrypt
 
I imagine you could achieve this with macros in Outlook which probably turns it into a VBA issue:


Provided you had access to encrypt and decrypt routines at both ends (sender and recipient) then that kind of approach would probably work.
 
i have been playing with the outlook forms but with no success , one of two ways would do it for me , either a html form that allows java inside it , or a vb form but im not expert and cant get the code to work right

Option Explicit

'Set to True to make the password case-sensitive
Const CASE_SENSITIVE_PASSWORD = False

Private Sub cmdEncrypt_Click()
txtText = EncryptText((txtText), txtPassword)
End Sub

Private Sub cmdDecrypt_Click()
txtText = DecryptText((txtText), txtPassword)
End Sub

'Encrypt text
Private Function EncryptText(strText As String, ByVal strPwd As String)
Dim i As Integer, c As Integer
Dim strBuff As String

If Not CASE_SENSITIVE_PASSWORD Then

'Convert password to upper case
'if not case-sensitive
strPwd = UCase$(strPwd)

End If

'Encrypt string
If Len(strPwd) Then
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c + Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr$(c And &HFF)
Next i
Else
strBuff = strText
End If
EncryptText = strBuff
End Function

'Decrypt text encrypted with EncryptText
Private Function DecryptText(strText As String, ByVal strPwd As String)
Dim i As Integer, c As Integer
Dim strBuff As String

If Not CASE_SENSITIVE_PASSWORD Then

'Convert password to upper case
'if not case-sensitive
strPwd = UCase$(strPwd)

End If

'Decrypt string
If Len(strPwd) Then
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c - Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr$(c And &HFF)
Next i
Else
strBuff = strText
End If
DecryptText = strBuff
End Function





it complains about the Private Function

im not sure this is even in the right place i dropped this in the code button on form design.
this is a working bit of code in vb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top