Connecting Tech Pros Worldwide Forums | Help | Site Map

How to encrypt a Table

Javier Gomez
Guest
 
Posts: n/a
#1: Nov 13 '05
I have a table with 15.000 records.
How can encrypt all information if after will shown in a form (text
box)decryted ?????

Thanks in advance
Javier Gomez

DFS
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to encrypt a Table


Javier Gomez wrote:[color=blue]
> I have a table with 15.000 records.
> How can encrypt all information if after will shown in a form (text
> box)decryted ?????
>
> Thanks in advance
> Javier Gomez[/color]

Javier,

Do you really need encryption, or just some minimum form of security to make
it difficult for others to read?

You can:

1) use the built-in Access security processes to "secure" the database
2) use a file system level encryption program - this is unrelated to MS
Access
3) look for encryption components someone has written to work with Access
4) write your own custom routines to encrypt and store the data, and decrypt
and display it.

Here are a couple cheesy routines that will disguise the data, and
undisguise it:

Public Function encryptPW(pWord As String) As String

encryptPW = ""
For I = 1 To Len(pWord)
encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
Next I

End Function


Public Function decryptPW(pWord As String) As String

decryptPW = ""
For I = 1 To Len(pWord)
decryptPW = decryptPW & Chr(Asc(MID(pWord, I, 1)) - 50)
Next I

End Function




Javier Gomez
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to encrypt a Table


Thank You ! it is ok !
But only missing variable in the function
regards
Javier

"DFS" <nospam@DFS.com> wrote in message news:<YcrXd.4168$2T6.4087@fe03.lga>...[color=blue]
> Javier Gomez wrote:[color=green]
> > I have a table with 15.000 records.
> > How can encrypt all information if after will shown in a form (text
> > box)decryted ?????
> >
> > Thanks in advance
> > Javier Gomez[/color]
>
> Javier,
>
> Do you really need encryption, or just some minimum form of security to make
> it difficult for others to read?
>
> You can:
>
> 1) use the built-in Access security processes to "secure" the database
> 2) use a file system level encryption program - this is unrelated to MS
> Access
> 3) look for encryption components someone has written to work with Access
> 4) write your own custom routines to encrypt and store the data, and decrypt
> and display it.
>
> Here are a couple cheesy routines that will disguise the data, and
> undisguise it:
>
> Public Function encryptPW(pWord As String) As String
>
> encryptPW = ""
> For I = 1 To Len(pWord)
> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> Next I
>
> End Function
>
>
> Public Function decryptPW(pWord As String) As String
>
> decryptPW = ""
> For I = 1 To Len(pWord)
> decryptPW = decryptPW & Chr(Asc(MID(pWord, I, 1)) - 50)
> Next I
>
> End Function[/color]
Javier Gomez
Guest
 
Posts: n/a
#4: Nov 13 '05

re: How to encrypt a Table


Only 1 more problem your decrypt function returns Uppercase letters.
Can you tell me how to resovel this problem ?

Thank you !
Javier Gomez


"DFS" <nospam@DFS.com> wrote in message news:<YcrXd.4168$2T6.4087@fe03.lga>...[color=blue]
> Javier Gomez wrote:[color=green]
> > I have a table with 15.000 records.
> > How can encrypt all information if after will shown in a form (text
> > box)decryted ?????
> >
> > Thanks in advance
> > Javier Gomez[/color]
>
> Javier,
>
> Do you really need encryption, or just some minimum form of security to make
> it difficult for others to read?
>
> You can:
>
> 1) use the built-in Access security processes to "secure" the database
> 2) use a file system level encryption program - this is unrelated to MS
> Access
> 3) look for encryption components someone has written to work with Access
> 4) write your own custom routines to encrypt and store the data, and decrypt
> and display it.
>
> Here are a couple cheesy routines that will disguise the data, and
> undisguise it:
>
> Public Function encryptPW(pWord As String) As String
>
> encryptPW = ""
> For I = 1 To Len(pWord)
> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> Next I
>
> End Function
>
>
> Public Function decryptPW(pWord As String) As String
>
> decryptPW = ""
> For I = 1 To Len(pWord)
> decryptPW = decryptPW & Chr(Asc(MID(pWord, I, 1)) - 50)
> Next I
>
> End Function[/color]
Trevor Best
Guest
 
Posts: n/a
#5: Nov 13 '05

re: How to encrypt a Table


Javier Gomez wrote:[color=blue]
> Only 1 more problem your decrypt function returns Uppercase letters.
> Can you tell me how to resovel this problem ?
>
> Thank you !
> Javier Gomez
>
>
> "DFS" <nospam@DFS.com> wrote in message news:<YcrXd.4168$2T6.4087@fe03.lga>...
>[color=green]
>>Javier Gomez wrote:
>>[color=darkred]
>>>I have a table with 15.000 records.
>>>How can encrypt all information if after will shown in a form (text
>>>box)decryted ?????
>>>
>>>Thanks in advance
>>>Javier Gomez[/color]
>>
>>Javier,
>>
>>Do you really need encryption, or just some minimum form of security to make
>>it difficult for others to read?
>>
>>You can:
>>
>>1) use the built-in Access security processes to "secure" the database
>>2) use a file system level encryption program - this is unrelated to MS
>>Access
>>3) look for encryption components someone has written to work with Access
>>4) write your own custom routines to encrypt and store the data, and decrypt
>>and display it.
>>
>>Here are a couple cheesy routines that will disguise the data, and
>>undisguise it:
>>
>>Public Function encryptPW(pWord As String) As String
>>
>> encryptPW = ""
>> For I = 1 To Len(pWord)
>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>> Next I
>>
>>End Function
>>
>>
>>Public Function decryptPW(pWord As String) As String
>>
>> decryptPW = ""
>> For I = 1 To Len(pWord)
>> decryptPW = decryptPW & Chr(Asc(MID(pWord, I, 1)) - 50)
>> Next I
>>
>>End Function[/color][/color]

Get rid of the ucase in the Encrypt function.


--
This sig left intentionally blank
Javier Gomez
Guest
 
Posts: n/a
#6: Nov 13 '05

re: How to encrypt a Table


Sorry but not understand !


Example:
(before encrypt)= Trevor Best
(Encryp)=xxxx
(after encryp)= TREVOR BEST
And I need after encrypt to get Trevor Best !

Can you please write the full code (considering uppercase words)?

Javier

Trevor Best <nospam@besty.org.uk> wrote in message news:<422eeaa4$0$8756$db0fefd9@news.zen.co.uk>...[color=blue]
> Javier Gomez wrote:[color=green]
> > Only 1 more problem your decrypt function returns Uppercase letters.
> > Can you tell me how to resovel this problem ?
> >
> > Thank you !
> > Javier Gomez
> >
> >
> > "DFS" <nospam@DFS.com> wrote in message news:<YcrXd.4168$2T6.4087@fe03.lga>...
> >[color=darkred]
> >>Javier Gomez wrote:
> >>
> >>>I have a table with 15.000 records.
> >>>How can encrypt all information if after will shown in a form (text
> >>>box)decryted ?????
> >>>
> >>>Thanks in advance
> >>>Javier Gomez
> >>
> >>Javier,
> >>
> >>Do you really need encryption, or just some minimum form of security to make
> >>it difficult for others to read?
> >>
> >>You can:
> >>
> >>1) use the built-in Access security processes to "secure" the database
> >>2) use a file system level encryption program - this is unrelated to MS
> >>Access
> >>3) look for encryption components someone has written to work with Access
> >>4) write your own custom routines to encrypt and store the data, and decrypt
> >>and display it.
> >>
> >>Here are a couple cheesy routines that will disguise the data, and
> >>undisguise it:
> >>
> >>Public Function encryptPW(pWord As String) As String
> >>
> >> encryptPW = ""
> >> For I = 1 To Len(pWord)
> >> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> >> Next I
> >>
> >>End Function
> >>
> >>
> >>Public Function decryptPW(pWord As String) As String
> >>
> >> decryptPW = ""
> >> For I = 1 To Len(pWord)
> >> decryptPW = decryptPW & Chr(Asc(MID(pWord, I, 1)) - 50)
> >> Next I
> >>
> >>End Function[/color][/color]
>
> Get rid of the ucase in the Encrypt function.[/color]
Bri
Guest
 
Posts: n/a
#7: Nov 13 '05

re: How to encrypt a Table


As advised, get rid of the UCase in the Encrypt function.

Line:
encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)

Becomes:
encryptPW = encryptPW & Chr(Asc(MID(pWord, I, 1)) + 50)

--
Bri

Javier Gomez wrote:[color=blue]
> Sorry but not understand !
>
>
> Example:
> (before encrypt)= Trevor Best
> (Encryp)=xxxx
> (after encryp)= TREVOR BEST
> And I need after encrypt to get Trevor Best !
>
> Can you please write the full code (considering uppercase words)?
>
> Javier
>[/color]

Original Function:
Public Function encryptPW(pWord As String) As String
encryptPW = ""
For I = 1 To Len(pWord)
encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
Next I
End Function


Javier Gomez
Guest
 
Posts: n/a
#8: Nov 13 '05

re: How to encrypt a Table


Thank you !
This problem is now arranged, but when I try to use this function in a
Query for Example 8.000 records the function starts making some debugs
problems I need to Cancel function sereval times until Access let me
quit from the Query.
What can I do ?

Regards
Javier Gomez


Bri <not@here.com> wrote in message news:<62%Xd.633803$6l.613535@pd7tw2no>...[color=blue]
> As advised, get rid of the UCase in the Encrypt function.
>
> Line:
> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>
> Becomes:
> encryptPW = encryptPW & Chr(Asc(MID(pWord, I, 1)) + 50)
>
> --
> Bri
>
> Javier Gomez wrote:[color=green]
> > Sorry but not understand !
> >
> >
> > Example:
> > (before encrypt)= Trevor Best
> > (Encryp)=xxxx
> > (after encryp)= TREVOR BEST
> > And I need after encrypt to get Trevor Best !
> >
> > Can you please write the full code (considering uppercase words)?
> >
> > Javier
> >[/color]
>
> Original Function:
> Public Function encryptPW(pWord As String) As String
> encryptPW = ""
> For I = 1 To Len(pWord)
> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> Next I
> End Function[/color]
Bri
Guest
 
Posts: n/a
#9: Nov 13 '05

re: How to encrypt a Table


Javier,

This wasn't my function, I was just pointing out how to use the advice
you were given in the other message.

As to your new problem, you will get more help if you tell us what error
number/message you are getting, what line it is happening on and what
the input is that you are trying to send to the function.

If I had to guess, I would say that you are sending a character that is
in the ASC value of 206 or more (because then adding 50 creates a new
character that is not a valid character since the max value is 255).
Since it seems that your native language is not english, it could be one
of the special accented letters. The way around this would be to test if
the ASC value +50 is greater than 206 and then subtract 206 from it
before you create the new character. You will need to do the reverse
test (ie check for value <50 and then add 206) on the decrypt function.

--
Bri

Javier Gomez wrote:[color=blue]
> Thank you !
> This problem is now arranged, but when I try to use this function in a
> Query for Example 8.000 records the function starts making some debugs
> problems I need to Cancel function sereval times until Access let me
> quit from the Query.
> What can I do ?
>
> Regards
> Javier Gomez
>
>
> Bri <not@here.com> wrote in message news:<62%Xd.633803$6l.613535@pd7tw2no>...
>[color=green]
>>As advised, get rid of the UCase in the Encrypt function.
>>
>>Line:
>>encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>>
>>Becomes:
>>encryptPW = encryptPW & Chr(Asc(MID(pWord, I, 1)) + 50)
>>
>>--
>>Bri
>>
>>Javier Gomez wrote:
>>[color=darkred]
>>>Sorry but not understand !
>>>
>>>
>>>Example:
>>>(before encrypt)= Trevor Best
>>>(Encryp)=xxxx
>>>(after encryp)= TREVOR BEST
>>>And I need after encrypt to get Trevor Best !
>>>
>>>Can you please write the full code (considering uppercase words)?
>>>
>>>Javier
>>>[/color]
>>
>>Original Function:
>>Public Function encryptPW(pWord As String) As String
>>encryptPW = ""
>>For I = 1 To Len(pWord)
>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>>Next I
>>End Function[/color][/color]


DFS
Guest
 
Posts: n/a
#10: Nov 13 '05

re: How to encrypt a Table


Bri wrote:[color=blue]
> Javier,
>
> This wasn't my function, I was just pointing out how to use the advice
> you were given in the other message.
>
> As to your new problem, you will get more help if you tell us what
> error number/message you are getting, what line it is happening on
> and what the input is that you are trying to send to the function.
>
> If I had to guess, I would say that you are sending a character that
> is in the ASC value of 206 or more (because then adding 50 creates a
> new character that is not a valid character since the max value is
> 255). Since it seems that your native language is not english, it
> could be one of the special accented letters.[/color]

Yes.

[color=blue]
> The way around this
> would be to test if the ASC value +50 is greater than 206 and then
> subtract 206 from it before you create the new character. You will
> need to do the reverse test (ie check for value <50 and then add 206)
> on the decrypt function.[/color]


And Javier, you should recognize I chose 50 arbitrarily. Any ASCII shift,
plus or minus, will [weakly] disguise your data. Remember, it can easily be
decrypted by any curious user who can find an ASCII table on the Web.

If you want to make your data really hard to read or decipher outside your
app, there are lots of tricks you can play with classic forms of encryption,
including letter substitution and transposition, and using a keyword and
routines hard-coded inside an .mde. These types of encryption generally
require very experienced cryptanalysts or computer analysis to decipher.

This webpage will give you a brief introduction to classic cryptography
http://library.thinkquest.org/27158/concept.html

There's a really interesting encryption method invented by the Germans in
World War 1. It's called ADFGVX, which are the only six letters used in the
ciphertext (the encrypted data). I wrote a VB program [for myself] that
used ADFGVX to encrypt/decrypt short paragraphs, and it ran quickly, but I
can't vouch for the speed if you tried to use it in an Access/VBA system.



[color=blue]
> Javier Gomez wrote:[color=green]
>> Thank you !
>> This problem is now arranged, but when I try to use this function in
>> a
>> Query for Example 8.000 records the function starts making some
>> debugs problems I need to Cancel function sereval times until Access
>> let me
>> quit from the Query.
>> What can I do ?
>>
>> Regards
>> Javier Gomez
>>
>>
>> Bri <not@here.com> wrote in message
>> news:<62%Xd.633803$6l.613535@pd7tw2no>...
>>[color=darkred]
>>> As advised, get rid of the UCase in the Encrypt function.
>>>
>>> Line:
>>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>>>
>>> Becomes:
>>> encryptPW = encryptPW & Chr(Asc(MID(pWord, I, 1)) + 50)
>>>
>>> --
>>> Bri
>>>
>>> Javier Gomez wrote:
>>>
>>>> Sorry but not understand !
>>>>
>>>>
>>>> Example:
>>>> (before encrypt)= Trevor Best
>>>> (Encryp)=xxxx
>>>> (after encryp)= TREVOR BEST
>>>> And I need after encrypt to get Trevor Best !
>>>>
>>>> Can you please write the full code (considering uppercase words)?
>>>>
>>>> Javier
>>>>
>>>
>>> Original Function:
>>> Public Function encryptPW(pWord As String) As String
>>> encryptPW = ""
>>> For I = 1 To Len(pWord)
>>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
>>> Next I
>>> End Function[/color][/color][/color]


Javier Gomez
Guest
 
Posts: n/a
#11: Nov 13 '05

re: How to encrypt a Table


Thak you again for your help and support !

1- You are right my mother tong is no English but I use English
Windows 2000 and English Access 2003 !

2-Your suggested link does not appear to work to day
http://library.thinkquest.org/27158/concept.html

3-When the Encryp function founds an accented word (in Spanish
language we have a lot of them)like for example: autobús

The query returns an #Error and stops showing this message:

Error in Run-time Error: "5"
Invalid procedure call or argument !


When next accented word is found in the Query (using the encryption
function)
Again the Query stops and so on........


My query is as follows:


Field (1): SPANISH
Table : tblDicctionary

Field (2): SPANISH ENCRYPTED:encryptPW([SPANISH])
Table: --No table----


4-I think the problem now is in the encryption function it selft, is
not considering accetuates words as good ones.



If you any other rutine or idea how to resolve the problem I will
apreciate it.

Regards

Javier Gomez















"DFS" <nospam@DFS.com> wrote in message news:<88xYd.18031$733.9942@fe07.lga>...[color=blue]
> Bri wrote:[color=green]
> > Javier,
> >
> > This wasn't my function, I was just pointing out how to use the advice
> > you were given in the other message.
> >
> > As to your new problem, you will get more help if you tell us what
> > error number/message you are getting, what line it is happening on
> > and what the input is that you are trying to send to the function.
> >
> > If I had to guess, I would say that you are sending a character that
> > is in the ASC value of 206 or more (because then adding 50 creates a
> > new character that is not a valid character since the max value is
> > 255). Since it seems that your native language is not english, it
> > could be one of the special accented letters.[/color]
>
> Yes.
>
>[color=green]
> > The way around this
> > would be to test if the ASC value +50 is greater than 206 and then
> > subtract 206 from it before you create the new character. You will
> > need to do the reverse test (ie check for value <50 and then add 206)
> > on the decrypt function.[/color]
>
>
> And Javier, you should recognize I chose 50 arbitrarily. Any ASCII shift,
> plus or minus, will [weakly] disguise your data. Remember, it can easily be
> decrypted by any curious user who can find an ASCII table on the Web.
>
> If you want to make your data really hard to read or decipher outside your
> app, there are lots of tricks you can play with classic forms of encryption,
> including letter substitution and transposition, and using a keyword and
> routines hard-coded inside an .mde. These types of encryption generally
> require very experienced cryptanalysts or computer analysis to decipher.
>
> This webpage will give you a brief introduction to classic cryptography
> http://library.thinkquest.org/27158/concept.html
>
> There's a really interesting encryption method invented by the Germans in
> World War 1. It's called ADFGVX, which are the only six letters used in the
> ciphertext (the encrypted data). I wrote a VB program [for myself] that
> used ADFGVX to encrypt/decrypt short paragraphs, and it ran quickly, but I
> can't vouch for the speed if you tried to use it in an Access/VBA system.
>
>
>
>[color=green]
> > Javier Gomez wrote:[color=darkred]
> >> Thank you !
> >> This problem is now arranged, but when I try to use this function in
> >> a
> >> Query for Example 8.000 records the function starts making some
> >> debugs problems I need to Cancel function sereval times until Access
> >> let me
> >> quit from the Query.
> >> What can I do ?
> >>
> >> Regards
> >> Javier Gomez
> >>
> >>
> >> Bri <not@here.com> wrote in message
> >> news:<62%Xd.633803$6l.613535@pd7tw2no>...
> >>
> >>> As advised, get rid of the UCase in the Encrypt function.
> >>>
> >>> Line:
> >>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> >>>
> >>> Becomes:
> >>> encryptPW = encryptPW & Chr(Asc(MID(pWord, I, 1)) + 50)
> >>>
> >>> --
> >>> Bri
> >>>
> >>> Javier Gomez wrote:
> >>>
> >>>> Sorry but not understand !
> >>>>
> >>>>
> >>>> Example:
> >>>> (before encrypt)= Trevor Best
> >>>> (Encryp)=xxxx
> >>>> (after encryp)= TREVOR BEST
> >>>> And I need after encrypt to get Trevor Best !
> >>>>
> >>>> Can you please write the full code (considering uppercase words)?
> >>>>
> >>>> Javier
> >>>>
> >>>
> >>> Original Function:
> >>> Public Function encryptPW(pWord As String) As String
> >>> encryptPW = ""
> >>> For I = 1 To Len(pWord)
> >>> encryptPW = encryptPW & Chr(Asc(MID(UCase(pWord), I, 1)) + 50)
> >>> Next I
> >>> End Function[/color][/color][/color]
Closed Thread