469,338 Members | 8,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

How to encrypt a Table

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
Nov 13 '05 #1
10 9006
DFS
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


Nov 13 '05 #2
Thank You ! it is ok !
But only missing variable in the function
regards
Javier

"DFS" <no****@DFS.com> wrote in message news:<Yc*****************@fe03.lga>...
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

Nov 13 '05 #3
Only 1 more problem your decrypt function returns Uppercase letters.
Can you tell me how to resovel this problem ?

Thank you !
Javier Gomez
"DFS" <no****@DFS.com> wrote in message news:<Yc*****************@fe03.lga>...
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

Nov 13 '05 #4
Javier Gomez wrote:
Only 1 more problem your decrypt function returns Uppercase letters.
Can you tell me how to resovel this problem ?

Thank you !
Javier Gomez
"DFS" <no****@DFS.com> wrote in message news:<Yc*****************@fe03.lga>...
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


Get rid of the ucase in the Encrypt function.
--
This sig left intentionally blank
Nov 13 '05 #5
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 <no****@besty.org.uk> wrote in message news:<42**********************@news.zen.co.uk>...
Javier Gomez wrote:
Only 1 more problem your decrypt function returns Uppercase letters.
Can you tell me how to resovel this problem ?

Thank you !
Javier Gomez
"DFS" <no****@DFS.com> wrote in message news:<Yc*****************@fe03.lga>...
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


Get rid of the ucase in the Encrypt function.

Nov 13 '05 #6
Bri
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
Nov 13 '05 #7
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 <no*@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

Nov 13 '05 #8
Bri
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:
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 <no*@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

Nov 13 '05 #9
DFS
Bri wrote:
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.
Yes.

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.

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.

Javier Gomez wrote:
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 <no*@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

Nov 13 '05 #10
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" <no****@DFS.com> wrote in message news:<88******************@fe07.lga>...
Bri wrote:
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.


Yes.

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.

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.

Javier Gomez wrote:
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 <no*@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

Nov 13 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Russ Reynolds | last post: by
3 posts views Thread by JellyON | last post: by
8 posts views Thread by Declan Barry | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.