15,880,796 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by i_syed2000 (Top 7 by date)
i_syed2000
13-Oct-17 11:06am
View
Can you explain how that works. It seems to be working for me as well. But I'm little confused how it is working. Is it because the code generation are built into the .net run time itself?
i_syed2000
22-Jun-16 15:30pm
View
Thanks xszaboj. But do you know if these tools are written by Microsoft using C/C++/.NET and Microsoft gave them the same name as NodeJs tools for sake ease?
i_syed2000
27-May-16 12:31pm
View
Its really big DB. I think foreign key constraints gets in the way of high volume transactional applications. But that may be another debate.
i_syed2000
27-May-16 12:02pm
View
Also there is no relationship defined between tables in the Database. Do you think it is possible to map that table structure to the domain model structure using the fluent API?
i_syed2000
27-May-16 10:42am
View
Thanks Dave. I'm sorry if I wasn't clear enough. You have Implemented DB Context correctly. However, I want to mention that table structure is existing. I will not be able to change it. Is it possible make this class hierarchy work with the table structure I have mentioned.
i_syed2000
10-Jul-13 17:49pm
View
Okay. So lets say my encrypted log file is 200 MB Long after months of log writing. I can load the whole file in Memory, decrypt it and show all at once to the user. However, I'm trying avoid hogging user's memory. If I decide to move forward with it, I will probably switch to AES. But first, I need to solve the problem mentioned above.
The problem part is the padding. Padding is only applied when the data block size is less than 64 bits. For some reason, .net code is not updating the 'decrypted' memory stream.
See code below.
Sample String Encrypted: ABCDEFGHI
Total Encrypted Bytes: 16 (because of padding).
Goal: Decrypt and read the first block which contains 'ABCDEFGH'.
string DecryptData(string encryptedData)
{
byte[] dataToDecrypt = Convert.FromBase64String(encryptedData);
byte[] decryptedData = new byte[8];
DESCryptoServiceProvider secProvider = new DESCryptoServiceProvider();
secProvider.Mode = CipherMode.ECB;
secProvider.Padding = PaddingMode.PKCS7;
secProvider.Key = ASCIIEncoding.ASCII.GetBytes(encryptionKey);
ICryptoTransform transform = secProvider.CreateDecryptor();
MemoryStream encryptedDataStream = new MemoryStream(dataToDecrypt);
MemoryStream decryptedDataStream = new MemoryStream();
CryptoStream stream = new
CryptoStream(decryptedDataStream,transform,CryptoStreamMode.Write);
stream.Write(dataToDecrypt, 0, 8);
stream.Flush();
//PROBLEM: doesn't flush bytes to decryptedDataStream unless I change padding to 'None'.
}
i_syed2000
10-Jul-13 17:28pm
View
Thanks Sergey. When using the ECB mode with DES, each block is encrypted standalone using the same key. So you can read each block and decrypt it independently of all the other blocks. In practice, I would really be reading one 'log line' which may span over mutiple encryption blocks.
For example consider the following log lines.
Line 1: Entering Method ABC\r\n
Line 2: Saving Customer\r\n
Line 3: Exiting Method ABC\r\n
Line 1 may span block 0 to N
Line 2 may span block N+1 to M
Line 3 may span block M+1 to ..
Show More