Skip to main content

Posts

How to Hash Passwords in C#: PBKDF2 & bcrypt Guide

Learn password hashing in C# the right way: salting, PBKDF2, bcrypt, and ASP.NET Core Identity, with runnable .NET code and best practices. Read the guide now. If your app stores user passwords, how you store them can decide whether a database breach is a small problem or front-page news. Password hashing in C# is one of the most important security skills a .NET developer can have, and it's also one of the most often done wrong. This guide explains what hashing and salting actually do, why plain SHA-256 isn't good enough, and how to use PBKDF2 , bcrypt , and ASP.NET Core Identity's PasswordHasher correctly. Every example is runnable code for modern .NET (8, 9, and 10). Whether you're a beginner looking up "how to hash a password in C#" or a senior engineer checking your team's approach against current OWASP guidance, you'll find practical, production-ready answers here. Why You Should Never Store Plain-Text or Encrypted Passwords Start with...
Recent posts

AWS S3 C# Tutorial: Upload, Download & List Files in .NET

Learn AWS S3 with C# step by step: upload, download, list and delete files, generate presigned URLs, and use S3 in ASP.NET Core. Read the full guide now. Amazon S3 is where much of the internet keeps its files: user uploads, invoices, backups, logs, static assets and data lake files. If you build on .NET, you'll probably need to use AWS S3 from C# at some point. This AWS S3 C# tutorial covers the whole process. You'll install the AWS SDK for .NET, configure credentials the right way, and upload, download, list and delete objects. You'll also learn presigned URLs, large-file multipart uploads, and a production-ready ASP.NET Core integration. The guide doesn't just show API calls. It also explains why each approach works, so you can avoid common mistakes like leaked access keys, memory spikes from large files, and surprise AWS bills. What Is Amazon S3? A Quick Primer for .NET Developers Amazon Simple Storage Service (S3) is an object storage service. It'...

TorchSharp Tutorial: Deep Learning in C# with PyTorch

Learn TorchSharp in C#: build, train, and deploy PyTorch neural networks in .NET with GPU support. Follow the tutorial and start coding today. If you're a .NET developer who wants deep learning without leaving C#, TorchSharp is the most direct way to get it. TorchSharp is a .NET library that exposes PyTorch's native engine (libtorch) to C#. You get tensors, automatic differentiation, GPU acceleration, and the same nn.Module style of building models that Python developers use. This TorchSharp tutorial takes you from installation to a trained neural network. Along the way it explains why the library works the way it does and covers the mistakes that catch most C# developers out. You might be a beginner searching "how to do deep learning in C#", an intermediate developer looking for TorchSharp best practices, or a senior engineer deciding whether PyTorch in C# is ready for production. Either way, this guide has what you need. What Is TorchSharp and Why Use It f...

Azure Functions vs AWS Lambda for C#: 2026 Cost & Speed

Azure Functions vs AWS Lambda for C# in 2026: cold starts, Native AOT, pricing math and real code. See the pricing math and pick the right platform. If you're building serverless apps in .NET, you'll hit the Azure Functions vs AWS Lambda question sooner or later. Both run C# well. Both charge per execution. Both claim to scale to zero. In 2026, though, the details that matter have changed. Azure's in-process model is being retired, the Flex Consumption plan has matured, AWS now bills the Lambda INIT phase, and Native AOT and SnapStart have made .NET cold starts much faster. This guide compares cold starts, throughput, and real pricing math, with runnable C# code for both platforms, so you can pick based on numbers. Azure Functions vs AWS Lambda: The 2026 Landscape at a Glance Before looking at benchmarks, here's what each platform offers C# developers today: Azure Functions : The isolated worker model is now the only supported way forward. Support for the...

Prompt Engineering in C#: Write Better AI Prompts (2026)

Learn prompt engineering in C# with runnable .NET examples: system prompts, few-shot, JSON output and prompt testing. Start writing better AI prompts today. Most C# developers can call an AI API in about ten lines of code. Getting reliable, predictable, production-quality output from it is harder. That part is prompt engineering . In this prompt engineering tutorial for C# developers, you'll learn how to write prompts that return consistent results. You'll also learn how to structure them in .NET code, get typed JSON back, defend against prompt injection and test prompts the way you test any other code. All examples use Microsoft.Extensions.AI , the provider-neutral abstraction for .NET. The same code works with OpenAI, Azure OpenAI, Anthropic Claude, Ollama or any other provider that supplies an IChatClient . Whether you're calling the OpenAI API from C#, building a ChatGPT-style feature or running a local model, these techniques carry over. What Is Prompt Engineer...