r/AskProgramming • • 56m ago

C# filestream writing to bitlocker drive binary files are corrupt, any ideas?

2 Upvotes

I wrote a program in c# that stores multiple files in a single file similar to zip or tar. That program just uses filestream writing, nothing fancy. I recently got a new computer, so I copied my compressed file onto the computer and was able to extract files from it.

After using my program, I used bitlocker on the ssd. Bitlocker gives you two options, use the old aes-cbc or new xts-aes cypher and if you want to do the entire drive or just existing files. I took the default of new xts-aes and only existing files. Let it run until the drive was encrypted and rebooted.

First thing I did after reboot was try to extract more files using my program and it found the input file corrupted. That shouldn't happen, but I just reloaded the file from a backup and things seemed to be working again. However, when I extracted to the encrypted ssd, text files were ok but media files like images and videos were corrupted. I used a diff tool and confirmed every single text was ok and every other file corrupted. Extracting from the same file on the encrypted ssd to a flash drive worked perfectly and nothing was corrupted. So only writing to the encrypted ssd from my app was having issues. Copying from the extracted files on the flash drive to the ssd also did not corrupt the files.

My understanding is bitlocker shouldn't care about the file type and it should be completely transparent to the application, yet thats not the behavior I was getting.

I then turned bitlocker off on the ssd, let it decrypt the drive and rebooted. The file on the ssd was not corrupted by the decrypt and extracts from the same file to the ssd now worked for all file types.

I turned bitlocker back on for the ssd and used the older aes-cbc and told it to encrypt everything including free space. After it completed and I rebooted, my program now correctly extracts files to the ssd.

So clearly other applications like the windows file copy didn't have issues with the bitlocker ssd and only my applcation did. I'm not able to come up with a theory as to how this could happen. I could see if everything was corrupted but the fact that text files are all ok is even more confusing. I used crystaldiskinfo to confirm there were no read or write failures on the ssd and the event logs don't show any errors reading or writing files to the ssd or bitlocker issues.

I guess my next step would be to decrypt the drive again and try the original bitlocker options to see if the problem returns. Any ideas what could be going on? Everything I've been able to read says bitlocker shouldn't care about the file type and bitlocker presence should be transparent to filestream writing in c#.


r/AskProgramming • • 22h ago

How can you prevent the Windows SmartScreen warning from appearing the first time you create a Windows application?

1 Upvotes

I've been working as a software engineer for the past 13 years, but I've never built applications for Windows. I'm now testing an idea, but I've run into an issue with SmartScreen protection and am unsure whether I need to verify my application at all.

Since I'm validating my idea, I don't want to register a company before I know whether my application is useful. It would mean extra expense and bureaucracy. If I understand correctly, without a company, I can sign my application as an individual (I'm based in the EU), but SmartScreen won't go away; it will just show my name as the publisher. And even if I sign as a company, users will still see a warning the first time they install each version. Since I release several versions per week and get up to 10 downloads a day, signing as a company wouldn't help much either.

I've added anonymous tracking to see whether users install my application, and I see that more than 90% don't. So I'm leaning toward the idea that the SmartScreen warning is scaring away my first users.

So my question is: is it worth it? How do people usually get started with a new Windows application? I don't think I'm the first to face this. Is there another option besides registering a company and signing the application under its name?

P.S. I also have a Mac version, and I was able to sign it with my personal identity, which resolved the issue.


r/AskProgramming • • 13h ago

Career/Edu how to study/read technical books like "Hands on Machine learning with Scikit-learn, keras and tenserflow"

0 Upvotes

ive recently got Hands on Machine learning with Scikit-learn, keras and tenserflow after going through a lot of recommendations on starting machine learning, im a second year college student pursuing my bachelors in AIML and i do have ML as my major. My major concern now is how do i study from a technical book? Im quite an avid reader but technical is a genre ive never touched except now. Any advice or tips to start my ml study journey from this book?


r/AskProgramming • • 17h ago

Other SpecKit experience?

0 Upvotes

What your experience regarding spec driven development especially using SpecKit?

Rather positive or different opinion?

For me personally Im a bit overwhelmed with all the bureaucracy with those constitutions and later having walls of text to digest.

Maybe my org done something wrong with this but it opened a Pandora box of problems we never had before.


r/AskProgramming • • 14h ago

WebRTC on localhost?

0 Upvotes

For a personal project, I needed to create a video call and screen sharing service, but to avoid paying for a server, I was wondering if it’s actually possible to run the server on localhost and have the other person connect through a Cloudflare tunnel. Do you know if this is possible? How feasible is it, and what problems might arise?


r/AskProgramming • • 4h ago

what is more complicated in CS between Bill built OS Windows vs Sergey, Larry invented a new algo PageRank for search engine?

0 Upvotes

r/AskProgramming • • 19h ago

Learning Python in an age of AI?

0 Upvotes

I am doing a degree apprenticeship in Cybersecurity over the next four years, and I’m lucky that my employer is paying me to do this, despite not “needing” it for my role.

One module in the first year is Python and, I won’t lie, I’m struggling. Initially, I enjoyed the learning, though it doesn’t come naturally to me. Despite spending lots of evenings and weekends on it, I’ve struggled to learn fast enough to keep up. I’ve got two big projects due in after Xmas, and I’m feeling a bit demoralised.

I think part of it is that I can see how easily AI blasts through this stuff. In a way, I’m quite excited about this. I enjoy using Claude to make my own small projects, and AI-assisted PowerShell scripting at work has been a real force multiplier. But nobody is ever going to pay me to sit there and write code. I can, however, see myself increasingly using it to make tools for my team's workflows.

When I finish this module, I’m going to have lots of other work to balance alongside my day job and home life, and I know I’ll forget a lot of this. It can leave me wondering what the point is.

Anyway, this isn't meant to be a downer. I’d like to take the positives from this experience. What would you say are the most important things to take away from learning programming that are still important and/or useful in an age of AI?