How LLMs Have Become a Part of Our Life!
Looking back, I haven’t used this space for a while. It’s 11:15 PM. I am sulking. Not sure why. No, I am not PMSing - just some mood swings. There was a time when this space was my biggest stress buster, and today, I thought I’d scribble something here. May be it’ll cheer me up
This is about how ChatGPT helped me with something unexpected today. I know everyone has stories like this. Here is one from me. :)
I had to upload a pdf online. However, it was password protected. I was skeptical about using an online tool since it was my bank statement and has my address in it. I tried little hacky things — first by uploading the document into google drive and trying to make a fresh pdf from there. It didn’t work. Then, I decided to our new friend — chatgpt.
Okay, something slightly off the topic. I am a big fan of google. Not sure why I’m still using chatgpt. I am quite happy with Gemini & I absolutely loved Google AI Studio, but, I continue to use ChatGPT. Probably, the power of marketing and branding, right? I am someone who sticks to the brands once I feel comfortable with it and as long as it is affordable and within my budget. Whether it is my car, phone, laptop, or internet service provider — I find it hard to switch to a different company or brand. Or I simply don’t switch.
I started with ChatGPT like everyone else and explored Gemini in between and continued using ChatGPT even after DeepSeek was launched.
Alright, back to the topic…
So, today’s experience is about removing the password protection from a pdf. When I asked chatgpt about the ways to get this done, it gave me multiple options and one of the options was to use code! And, I thought of trying it out. It was a small compact code. I wasn’t sure if it would work seamlessly. I created a virtual environment and installed pypdf & ran the script. As expected, it failed.
from pypdf import PdfReader, PdfWriter
def remove_pdf_password(input_pdf, output_pdf, password):
reader = PdfReader(input_pdf)
if reader.decrypt(password): # Try unlocking the PDF
writer = PdfWriter()
for page in reader.pages:
writer.add_page(page)
with open(output_pdf, "wb") as output_file:
writer.write(output_file)
print(f"Password removed successfully! Saved as {output_pdf}")
else:
print("Failed to decrypt. Check the password.")
# Example Usage:
input_pdf = "protected.pdf" # Replace with your file name
output_pdf = "unlocked.pdf" # New PDF without password
password = "your_password" # Replace with the actual password
remove_pdf_password(input_pdf, output_pdf, password)
File “/Users/pyarisingh/Desktop/pdf_env/lib/python3.8/site-packages/pypdf/_crypt_providers/_fallback.py”, line 93, in aes_cbc_decrypt
raise DependencyError(_DEPENDENCY_ERROR_STR)
I pasted the error and it comes back saying that the error is likely because pypdf
requires PyCryptodome for decrypting AES-encrypted PDFs. You can fix it by installing the missing dependency.
I quickly installed PyCryptodome & ran the script again.
Tada! My pdf was no longer password protected!

For someone who grew up with power cuts and a world without telephones, technology continues to amaze me every single day.
To wrap this up on a slightly philosophical note — in the mid of all the luxuries, I just wish the world were a little kinder and less filled with hatred.