How to handle expired SQL logins’ passwords in client code

Microsoft is always advise customers to use the new security features for SQL Logins in SQL Server. As you know SQL Logins are the logins where the login name and password are saved inside SQL Server and SQL Server is responsible for authenticated this login. We don’t depend on Windows to validate them. Of course…


MS File Encryption

As I promised in my last post, here’s the MS File Encryption program (MS stands for Mohamed Sharaf not Microsoft of course ;)) based on the MSSecurity Library. The application is pretty simple; you can encrypt a single file or entire folder. The application adds the extension MSEnc to the file when encrypting and remove it…


Back to MSSecurity library again

If you have seen my previous post about the class library that I developed to encrypt text or files using symmetric encryption (Rijndael algorithm). So you would already know that it was developed using .NET Framework 1.1. I’ve upgraded the library to .NET Framework 2.0 and fixed a bug I discovered in the decryption methods….


Cross post with Master pages

I got a feedback for the Master Pages post asking about mixing master pages with cross post. Here’s the scenario. We have a content page that has one textbox and one button, the page code would be like this <%@ Page Language=”VB” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”false” CodeFile=”master_form.aspx.vb” Inherits=”master_form” title=”Untitled Page” %> <asp:Content ID=”Content1″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”> <asp:TextBox ID=”id”…


How to move objects from Schema to another in SQL 2005

If you are building CLR stored procedure and you want this stored procedure to be part of a schema called xyz. When you write the name of the procedure in the SqlProcedure attribute “xyz.myproc” and deploy this procedure, the visual studio deployed it with dbo schema and the name of the procedure will be….


Changing application settings programmatically in .NET Framework 2.0

As I promised to provide a component to enable you to change the values of the application-scope settings in .NET Framework 2.0, I’m now providing it. It’s a very simple dll written by C#, you can find the Source code here. To use this dll you will need to get instance from the SettingWriter class…


Using application/user settings in C# 2.0

This is a quick post for using application or user settings in C# 2.0. I found most of the articles dealing with it in VB which is pretty easy. All you need to access a setting called “ServerName” in Visual Basic is this line My.Settings.ServerName=”myServer” For more information about settings you can refer to MSDN…


Adding custom code to Local Reports in Visual Studio.NET 2005 (Problems & Solutions)

If you are one of the people who used and enjoyed SQL Server Reporting Services (SSRS) in SQL 2000 and you wanted to use it in your windows/web applications without the server side components (just like what you are doing with Crystal Reports). So you would be much exited about the new ReportViewer Controls. ReportViewer…


Encrypting configuration files using protected configuration

One of the cool security features in ASP.NET 2.0 is the ability to parts of web.config. Web.config encryption uses XML encryption standards at its core.   Protected configuration uses a class derived from the abstract class ProtectedConfigurationProvider. .NET framework has shipped with two providers RSAProtectedConfigurationProvider which uses TripleDES and RSA encryption and DPAPIProtectedConfigurationProvider which uses…


MSecurityLibrary library for symmetric encryption and hashing

This time I’m introducing one of the most favorite codes for me. I built this library a year ago while I was working with symmetric encryption. I felt that I need to do it myself instead of using any ready-made components because I either found a very complex component or a very simple one that…