• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Header

adalberto

New Member
I need a routine to locate, in the XLS file header, the string generated by the password entered by the user in an excel spreadsheet.

I want to use the string generated by the user's password to encrypt data in a database that will be manipulated by the excel.


If possible, for 2003 and 2010 version.
 
What is the header you are referring to? does the file name have the password? Do you want an input box to appear for the user to input a password? Please provide more info.
 
The header is a "block of information about file content". To access the file header you need to open the "XLS" file as a binary file. The information about password, format, version,... are in the header of file.
 
You mean the page header, like what you see when you print the worksheet? If that's what you're wanting to access, you can detect those strings via one of the following

[pre]
Code:
Sub GetStrings()
Dim LeftH As String
Dim CenterH As String
Dim RightH As String
With ActiveSheet.PageSetup
LeftH = .LeftHeader
CenterH = .CenterHeader
RightH = .RightHeader
End With

'What now?
End Sub
[/pre]
If the password/string that you want is within one of these, we'll need more info as to what we're looking for exactly in order to parse the string(s) correctly.
 
Hi, adalberto!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


I agree with Luke M regarding your reference to "file header". Would you please elaborate a bit more?

As a blind shot, in the attached file, are you referring to something like this?:

a)

-----

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<encryption xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><keyData saltSize="16" blockSize="16" keyBits="128" hashSize="20" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA1" saltValue="jsovZTfmyGQVV/D/GRmQ0g=="/><dataIntegrity encryptedHmacKey="JoZR7rAsNoREqItVTVlpgakjcÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

-----

b)

-----

encryptedHmacValue="HTJp3rv7El/Km/Ve7tJY6rbMKIalef+eDDDPOxTH234="/><keyEncryptors><keyEncryptor uri="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><p:encryptedKey spinCount="100000" saltSize="16" blockSize="16" keyBits="128" hashSize="20" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA1" saltValue="N8q/+/tU4Kmf/pNPKzC6Kg==" encryptedVerifierHashInput="vLfRNVUrb5vEtfKeAypJnQ==" encryptedVerifierHashValue="nJqX8nYmRfAvvArpJrB3DCE8P5FsVFfSsEdAYIVxD28=" encryptedKeyValue="qB69aFUtVhzY2KdT/vVGZA=="/></keyEncryptor></keyEncryptors></encryption>

-----


Link:

https://dl.dropbox.com/u/60558749/Excel%20Header%20%28for%20adalberto%20at%20chandoo.org%29.xlsx

Password (unquoted): "adalberto from Brazil"


Regards!
 
Hi, adalberto!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


I agree with Luke M regarding your reference to "file header". Would you please elaborate a bit more?

As a blind shot, in the attached file, are you referring to something like this?:

a)

-----

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<encryption xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><keyData saltSize="16" blockSize="16" keyBits="128" hashSize="20" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA1" saltValue="jsovZTfmyGQVV/D/GRmQ0g=="/><dataIntegrity encryptedHmacKey="JoZR7rAsNoREqItVTVlpgakjcÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

-----

b)

-----

encryptedHmacValue="HTJp3rv7El/Km/Ve7tJY6rbMKIalef+eDDDPOxTH234="/><keyEncryptors><keyEncryptor uri="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><p:encryptedKey spinCount="100000" saltSize="16" blockSize="16" keyBits="128" hashSize="20" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA1" saltValue="N8q/+/tU4Kmf/pNPKzC6Kg==" encryptedVerifierHashInput="vLfRNVUrb5vEtfKeAypJnQ==" encryptedVerifierHashValue="nJqX8nYmRfAvvArpJrB3DCE8P5FsVFfSsEdAYIVxD28=" encryptedKeyValue="qB69aFUtVhzY2KdT/vVGZA=="/></keyEncryptor></keyEncryptors></encryption>

-----


Link:

https://dl.dropbox.com/u/60558749/Excel Header (for adalberto at chandoo.org).xlsx

Password (unquoted): "adalberto from Brazil"


Regards!
please i need urgent help...
i forgot password that i used in my excel :(
here's the code:
encryptedHmacKey="zYq0/Jy1qEWKd6CwnEwWdPBpJYNGU0xqgPnSU2WDCqq9+dMtoHFF1O2nQnoZjIbxNpJHjD/w4gkCfX8rainQGw==" encryptedHmacValue="GCr6TzpkXfJWUnEnPZ25Q6u/vX9vCG4LTSjJB2bLnQV4z9Hd8/T4iypKiaPGBrQwxkr4F+ZjvGe0oFQrQ2I+aA=="/><keyEncryptors><keyEncryptor uri="http://schemas.microsoft.com/office/2006/keyEncryptor/password"><p:encryptedKey spinCount="100000" saltSize="16" blockSize="16" keyBits="256" hashSize="64" cipherAlgorithm="AES" cipherChaining="ChainingModeCBC" hashAlgorithm="SHA512" saltValue="9qlFzPgV7+tHEO4WpBNBaw==" encryptedVerifierHashInput="jLNmocf6b9YrduQcstZ+Kw==" encryptedVerifierHashValue="STKCmvVI/CTQILRG8irGx60xfyusP+Hc+o5J1YcTnFXh+HGQop2IvOZqmekAkz2cdrebIENEFIVLaxRAF14v1A==" encryptedKeyValue="OK3WtRFwelnWIXsBxgXvwMYF5P3Pz67kztf3JbwFA4c="/></keyEncryptor></keyEncryptors></encryption>
 
Back
Top