473,626 Members | 3,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database Password

I have some code which uses the now unsupported "ChrB" function. The code
worked in A97 but does not with A2k3. Can anyone tell me what the following
arguments equate to? Many thanks.

ChrB(19)
ChrB(40)
ChrB(54)
ChrB(55)
ChrB(68)
ChrB(84)
ChrB(93)
ChrB(94)
ChrB(96)
ChrB(123)
ChrB(134)
ChrB(138)
ChrB(148)
ChrB(156)
ChrB(182)
ChrB(198)
ChrB(230)
ChrB(236)
ChrB(251)
ChrB(250)
Dec 13 '05 #1
21 2774
Keith W wrote:
I have some code which uses the now unsupported "ChrB" function. The code
worked in A97 but does not with A2k3. Can anyone tell me what the following
arguments equate to? Many thanks.

ChrB(19)
ChrB(40)
ChrB(54)
ChrB(55)
ChrB(68)
ChrB(84)
ChrB(93)
ChrB(94)
ChrB(96)
ChrB(123)
ChrB(134)
ChrB(138)
ChrB(148)
ChrB(156)
ChrB(182)
ChrB(198)
ChrB(230)
ChrB(236)
ChrB(251)
ChrB(250)


ChrB(X) simply returns a one byte string representation of X. It may be
difficult to print or see.
Chr(X) returns a two byte unicode representation of X which is easy to
print or see.

Since you are asking in a Password thread I'm guessing these one bytes
are easier, better to use in some kind of byte comparison or operation,
perhaps XOR in Western. There is not much point on operating on zeros as
every other byte.
If so, I'm guessing that just loading the string into a byte array would
be easier, but I'm speculating here.

--
Lyle Fairfield
Dec 13 '05 #2
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:_3******** ********@read1. cgocable.net...

ChrB(X) simply returns a one byte string representation of X. It may be
difficult to print or see.
Chr(X) returns a two byte unicode representation of X which is easy to
print or see.

Since you are asking in a Password thread I'm guessing these one bytes are
easier, better to use in some kind of byte comparison or operation,
perhaps XOR in Western. There is not much point on operating on zeros as
every other byte.
If so, I'm guessing that just loading the string into a byte array would
be easier, but I'm speculating here.

Hi Lyle, thanks for your response. I'm right on the edge of my knowledge on
this so thanks for your patience. Here's the full code (you're right about
the XOR) - IIRC it originated from Micheal Kaplan (and I've probably spelt
that wrong). It works in A97 but not in A2k3. It seems to fall over where
the empty password array is set. Any help greatly appreciated. And before
anyone jumps in with the rights and wrongs of password cracking, I have a
genuine and legal use for a working version of this code.

Public Function StPasswordOfStD atabase(stDatab ase As String) As String
Dim hFile As Integer
Dim ich As Integer
Dim stBuffer As String
Dim rgbytRaw() As Byte
Dim rgbytPassword() As Byte
Dim rgbytNoPassword () As Byte

' Create the byte array with the 20 bytes that are present when there
' is no database password
rgbytNoPassword = ChrB(134) & ChrB(251) & ChrB(236) & ChrB(55) &
ChrB(93) & _
ChrB(68) & ChrB(156) & ChrB(250) & ChrB(198)
& ChrB(94) & _
ChrB(40) & ChrB(230) & ChrB(19) & ChrB(182)
& ChrB(138) & _
ChrB(96) & ChrB(84) & ChrB(148) & ChrB(123)
& ChrB(54)

' Grab the 20 bytes from the real file whose password
' we are supposed to retrieve
hFile = FreeFile
Open stDatabase For Binary As #hFile
Seek #hFile, 66 + 1
rgbytRaw = InputB(20, #hFile)
Close #hFile

' Enough prep, lets get the password now.
ReDim rgbytPassword(0 To 19)
For ich = 0 To 19
rgbytPassword(i ch) = rgbytRaw(ich) Xor rgbytNoPassword (ich)
Next ich

' Add a trailing Null so one will always be found, even if the password
is 20
' characters. Then grab up to the first null we find and return the
password
stBuffer = StrConv(rgbytPa ssword, vbUnicode) & vbNullChar
'StPasswordOfSt Database = Left$(stBuffer, InStr(1, stBuffer, vbNullChar,
vbBinaryCompare ) - 1)
StPasswordOfStD atabase = stBuffer

'To reveal the password, type this into the debug window: ?
StPasswordOfStD atabase("c:\foo .mdb")
'Where("c:\foo. mdb") is the path to and name of the db file

End Function
Dec 13 '05 #3
ChrB is still supported in Access 2003. From the Help file:

The Chr function in Microsoft Access always returns 2-byte characters. In
previous versions of Microsoft Access, Chr(&H41) and ChrB(&H41) were equal,
but in the current version of Microsoft Access, Chr(&H41) and ChrB(&H41) +
ChrB(0) are equal.

?Chr(19) = (ChrB(19) & ChrB(0))
True
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Keith W" <he**@there.com > wrote in message
news:43******** **@glkas0286.gr eenlnk.net...
I have some code which uses the now unsupported "ChrB" function. The code
worked in A97 but does not with A2k3. Can anyone tell me what the
following arguments equate to? Many thanks.

ChrB(19)
ChrB(40)
ChrB(54)
ChrB(55)
ChrB(68)
ChrB(84)
ChrB(93)
ChrB(94)
ChrB(96)
ChrB(123)
ChrB(134)
ChrB(138)
ChrB(148)
ChrB(156)
ChrB(182)
ChrB(198)
ChrB(230)
ChrB(236)
ChrB(251)
ChrB(250)

Dec 13 '05 #4
"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:M-*************** *****@rogers.co m...
ChrB is still supported in Access 2003. From the Help file:

The Chr function in Microsoft Access always returns 2-byte characters. In
previous versions of Microsoft Access, Chr(&H41) and ChrB(&H41) were
equal, but in the current version of Microsoft Access, Chr(&H41) and
ChrB(&H41) + ChrB(0) are equal.

?Chr(19) = (ChrB(19) & ChrB(0))
True

So it looks like my problem is that the blank database password string is
different between 97 and 2k3, is that a reasonable assumption? As I stated
in my reply to Lyle, this code works in A97.

Keith.
Dec 13 '05 #5
Or its location is different. Or the whole procedure has been changed.
Or there are bad sunspots today.
This !!!!!should be!!!! easy (with the example in front of us) but
maybe it isn't. Regardless, I have qualms.
I'd start on location.

Dec 13 '05 #6
"Keith W" <he**@there.com > wrote in message
news:43******** **@glkas0286.gr eenlnk.net...
"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:M-*************** *****@rogers.co m...
ChrB is still supported in Access 2003. From the Help file:

The Chr function in Microsoft Access always returns 2-byte characters. In
previous versions of Microsoft Access, Chr(&H41) and ChrB(&H41) were
equal, but in the current version of Microsoft Access, Chr(&H41) and
ChrB(&H41) + ChrB(0) are equal.

?Chr(19) = (ChrB(19) & ChrB(0))
True

So it looks like my problem is that the blank database password string is
different between 97 and 2k3, is that a reasonable assumption? As I
stated in my reply to Lyle, this code works in A97.


Looks like you're talking about the code MichKa has at
http://www.trigeminal.com/code/DatabasePassword.bas

Note that that code is only for Jet 3.0/3.5 databases (i.e. Access 95 or
Access 97)

As MichKa says at http://www.trigeminal.com/codes.asp?ItemID=5#5, "the Jet
4.0 database password is not even close to this easy to crack"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

Dec 13 '05 #7
"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:ju******** *************** *******@rogers. com...

As MichKa says at http://www.trigeminal.com/codes.asp?ItemID=5#5, "the Jet
4.0 database password is not even close to this easy to crack"


Ah, thanks for that, I vaguely remember reading that ages ago but had
forgotten about it.

Regards,
Keith.
Dec 13 '05 #8
Douglas J. Steele wrote:
As MichKa says at http://www.trigeminal.com/codes.asp?ItemID=5#5, "the Jet
4.0 database password is not even close to this easy to crack"


How close is not even close? Perhaps, Michka was crying wolf (maybe
that's not the right expression) in order to discourage the casual
hacker.

Dec 13 '05 #9
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Douglas J. Steele wrote:
As MichKa says at http://www.trigeminal.com/codes.asp?ItemID=5#5, "the
Jet
4.0 database password is not even close to this easy to crack"


How close is not even close? Perhaps, Michka was crying wolf (maybe
that's not the right expression) in order to discourage the casual
hacker.


Don't know. Since I never use database passwords, I've never bothered
checking.

OTOH, since he gave the code to retrieve 3.0/3.5 passwords, if the 4.0
passwords were that easy to retrieve, I see no reason why he wouldn't have
given that code as well.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

Dec 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2884
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the MySql folder on drive C. However, when I'm in Dreamweaver I click on Applications at the side, and the plus button to add a MySql database. It tells me to enter the
5
3036
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I write some PHP code which should, I think, be able to to auto create the tables. The SQL looks like this:
8
18453
by: John | last post by:
Hello. I am currently working through a book on Dreamweaver and using PHP. I am having a little trouble with setting up the database though. I have php 4.2.3 and MySQL 4.0.20a. I am running locally with Apache 1.3.27 on Windows XP Pro. I seem to have finally got MySQL running after a lot of difficulty. In the book it says to type source C:\mysql\newland_tours.sql at the mysql> prompt, to generate the newland_tours database in my...
20
17621
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the db is not enable for the specified action", do i miss sth else?
6
2384
by: N. Graves | last post by:
Thank you for taking your time to read my question... please offer your knowledge it will be appreciated! I'm writing a ASP Web page to access a Access Database that has a Database Password set. If I remove the password I'm able to read and work with the database. Here is the code that I have to open the connection to the Database: Set objDB = Server.CreateObject("ADODB.Connection")
5
16909
by: scorpion53061 | last post by:
is it possible to set the database password that you can set in access for a database from a vb.net application?
0
7690
bartonc
by: bartonc | last post by:
#Boa:Dialog:DBConnectDialog import wx ##"""Given a set if login specs, create a dbServer instance and ## ensure that there is a valid, open connection to the database. ## If not, set the dbConnect to None. ## spec: dict(UserName=name, Password=pswd, ServerName=host) ## Allow names to be set with Default Holder. Consiter Dictionary ## or even a tuple? (name, pswd, host)"""
39
5848
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
7
3355
by: Deccypher | last post by:
Hi Im trying to do something a little more complex with my login script at the moment it works fine, checks the username and password with the database if its wrong it echo's a error and if its right redirects the user to the main page with the session variable logged_in = true but what i have done now is added more feileds into the user table name company email ect. what i want to do is on successful login pull the users information and...
16
8371
by: Greg (codepug | last post by:
If one converts that .mdb into an .mde the code is secure but the tables can still be imported. Just for Very Basic protection, I have placed a Password on the database using the "Set Database Password" option. Now it requires that the password be entered each time you start the database. How do I enter the Password using code, so that the database starts up without having to type it in ??? I notice that there is a way in code to set...
0
8268
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8641
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.