473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 9564
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
3
by: Russ Reynolds | last post by:
SQL Server 2000: ######################################################## I run the following as a normal query from Analyzer: ######################################################## SELECT...
3
by: JellyON | last post by:
Do you know about an encryption script which accepts the accentued characters. I've found the one below (from WebExpert premade scripts), but when you encrypt "assurément", then reverse the...
20
by: Drebin | last post by:
It's a long story really, but the bottom line is we need to encrypt or obfuscate a clear-text 9-digit SSN/taxpayer ID into something less than 21 characters. It doesn't need to be super-secure,...
1
by: Tommy | last post by:
I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt method to encrypt the cookie. However, I do not...
3
by: Alex Nitulescu | last post by:
Hi. I am writing an app which stores usernames/passwords and email addresses in a database table. The question is how can I encrypt the password provided by the user ? ...
8
by: Declan Barry | last post by:
Hi all.. Does anyone have a php script that would allow me to encrypt the contents of a txt file? I have an excel file which has a list of usernames and generated passwords. What I would...
3
by: rcamarda | last post by:
Hello, While working through my encryption questions from preivous posts, I am finding that I may have to resort to use triggers to do the encryption (not that this is the only way, but might be...
2
by: fineman | last post by:
Hi all, I want to get a 64bit(8 bytes) Encrypt result use DES class in the VS2005. Though I encrypt data is 64bit(8 bytes), but DES return encrypt result that always is 128bit(16 bytes), I don't...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.