2018-07-29

Cracking pdf user password with partially known pattern

Introduction

Last week I attempted to open an old CITIbank statements in 2015 October.  I forgot my default password of coursey, and the hint didn't help.

The hint provides the information:
The default password composed of your C.E. birthday (yyyymmdd) and the last 4 digits of your ATM card number.

Bad things to me that the Taiwan branch of CITIbank swapt old ATM card to new one with debit card function in 2016, and I don't remember the old card number of course again.

Main Issue

So, question is - how can I open this encrypted pdf with a 12-digit user password, including a known  8-digit birthday date and unknown 4-digit card number?

Brute force password cracker!

Pdfcrack

I found that pdfcrack developed in early 2010's could do this job.  However, this 10 years ago software could only executed in single thread, and guess the 12-digit password from 000000000000 to 999999999999!  That is way too far and time consuming to me.

A better adapted version of pdfcrack I also found is pdfcrack-mp-baseopenmp (github page). It added a pattern based brute force cracking with openMP support, which is more useful in my purpose.

I download the git package, deleted the .gitignore, and compile the program under cygwin with make and gcc (Noting that this compilation will not work under cmd, but cygwin only).

I backup the program on my onedrive: https://1drv.ms/u/s!AuRau9aDs5yjlRkWKoPKpd4Dxpy_
  • Download and decompress the folder
  • Enter cygwin into the folder
  • Make all in the folder
  • execute the pdfcrack with known parameters
For example, My birthday is 20180729, today, and I would like to crack the last 4 digits of pdf password with 4 threads of cpu, my command would be:
./pdfcrack.exe -t 4 -e [2][0][1][8][0][7][2][9][1234567890][1234567890][1234567890][1234567890] -f filename.pdf
This means that guessing the password with 12 digits.  First 8 digits are known, and possibility is 1.  Last 4 digits are unknown, with 10 possibility for each digit (0 to 9).

With my poor i3-2310m, I decrypted the password with 5 second.  I did have tried the last version of pdfcrack developed in 2009, but it didn't guess the correct password in 1 day.


2017-10-19

Print letter size document in Microsoft Office(Word, Excel) outside US

Sometimes we want to print a letter size document in the computer/printer set for A4 paper.  We could easily finish the printing by selecting the "letter size" in the program or in the printer configuration for conventional document software, like sumatra pdf reader, pdf xchange, notepad++, .etc.


However, I cannot do it on microsoft office 2016, like word or excel.  Either printer will print the document in A4 paper (for the case I put both A4 paper and letter size paper in paper tray), or got error message "loading no A4 paper in the tray" in Fuji xerox DocuCentre (for the case only the letter size paper provided).  

How could it happen?

I checked those settings set as letter size
1. "Printing Preference" in Windows 10 - Device & Printers setting folder

2. Assign Letter size in Word/Excel Configuring Print option and Printer Properties
 


3. Physically check printer load Letter size paper
4. Printer recognize the Letter size paper is loaded



But I still cannot print letter size paper with Word/Excel.  Why?

In the HP forum, there is a self solved discussion by hansCNX (Link).  He found the office setting should take the responsible for this issue.  

1) Open up a Word Doc + Click the "FILE" on left top corner > select "Options" > "Advance" > "Print"


2)  UN-tick the following item: "Scale content for A4 or 8,5 x 11" paper sizes" + OK



Then we solve the issue. Oh yeh!

2017-08-31

Process capability for non-normal distribution using Minitab 12

Six sigma training introduces how to analyze process capability on normal distribution data. Firstly, plotting and analyzing data with normal distribution:
state - Basic Statistics - Display Descriptive Statistics
Secondly, six sigma theory distinguishes the fitness of data to suspected distribution by p-value. The test rejects the hypothesis of normality when the p-value is less than or equal to 0.05 (1 possible exception over 20 cases should be considered).
However, read line (calculated normal distribution) is not fitted to our data. Our data is activity time measured in Minute. Time measurement is always larger than 0, and thus our data is obviously not a zero-centered normal distribution.
p-value=0.00 means the null hypothesis, data fit normal distribution, fails as well. So, question is - <>how to fit our data to other distribution, and find a acceptable p-value larger than 0.05.
After searching the internet and manual for v12, version 12 provide no capability to fit data into non-normal distribution and find related p-value. Version 18 could fit several potential candidates, and calculate corresponding p-value sapaterly[reference: How to Identify the Distribution of Your Data using Minitab].
There is alternative way to do the magic - Box-Cox Transformation for Non-Normal Data [MINITAB User’s Guide 2: Data Analysis and Quality Tools, revision 12 1998, section 12].
The Box-Cox transformation can be used to correct both non-normality in process data.....
Under most conditions, it is not necessary to correct for non-normality unless the data are highly skewed.
MINITAB provides two Box-Cox transformations: ...
First, use the stand-alone command as an exploratory tool to help you determine the best lambda value for the transformation.
Then, when you enter the control chart command, use the transformation option to transform the data at the same time you draw the chart.
So, process capability for my cases is:
1. Find a lambda for data transformation (0.225)
2. use the transformed data to pass p-value test for normal distribution hypothesis.
3. analyze the process capability on transformed data or origin data with lambda.

Cracking pdf user password with partially known pattern

Introduction Last week I attempted to open an old CITIbank statements in 2015 October.  I forgot my default password of coursey, and the h...