115 Chapter 06

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25
At a glance
Powered by AI
The document discusses C# programming concepts like the .NET Framework, encryption techniques and Caesar cipher exercises.

It is a component of Windows that includes a virtual execution system called the CLR and a unified set of class libraries.

Symmetric encryption uses the same key for encryption and decryption while asymmetric encryption uses a public and private key.

The Complete C# Developer Course

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Advanced C# Part 1

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Advanced C# Part 1

.NET Framework

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
.NET Framework

C# programs run on the .NET Framework


.NET Framework

What is .Net framework?

It is a component of Windows that includes a virtual execution system


called the (CLR) Common Language Runtime and a unified set of class
libraries.
.NET Framework
.NET Framework
System
System.Activities
System.Collections
System.Data
System.Diagnostics
System.DirectoryServices
System.Drawing
System.Globalization
System.IO
System.Linq
Framework Class Libraries System.Management
System.Messaging
System.Net
https://msdn.microsoft.com/en-us/library/mt472912.aspx System.Printing
System.Resources
System.Security
System.Speech
System.Text
System.Threading
System.Timers
System.Web
System.Windows
Advanced C# Part 1

Build, Rebuild and Clean

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Build, Rebuild and Clean

Build Re-Build Clean

Build the files that Clean then build the Delete all compiled
have been modified solution from scratch, files (i.e., EXEs and
since the last ignoring any previous DLLs) from the bin/obj
successful compile complies made before directory.
(Incremental)
Advanced C# Part 1

string VS String

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
string VS String

string is a keyword in Base Class Library (BCL)


directly maps

System.String in Framework Class Library (FCL)

string is an alias for the System.String


string VS String
bool System.Boolean
byte System.Byte
sbyte System.SByte
char System.Char
decimal System.Decimal
double System.Double
float System.Single
int System.Int32
uint System.UInt32
long System.Int64
ulong System.UInt64
object System.Object
short System.Int16
ushort System.UInt16
string System.String
Advanced C# Part 1

Documentations

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Advanced C# Part 1

Snippets

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Advanced C# Part 1

Exercise file creator

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Exercise file creator

Enum Languages Corresponding folders Inside each folder


English English English\log.txt
German Create directory German Create files German\log.txt
Arabic Arabic Arabic\log.txt
Chinese Chinese Chinese\log.txt
.. .. ..
etc etc etc

Sample text inside file


File no 1, created on date and time
Advanced C# Part 1

Introduction to cryptography

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Cryptography

Cryptography is a way of storing and transmitting data in a particular form unlike its
normal form

Terms

Encryption:
The process of converting information using cryptography. Information that has been converted this way is
called encrypted.

Decryption:
The process of unlocking the encrypted information using cryptographic techniques.

Key:
A secret like a password used to encrypt and decrypt information.
Cryptography

Types of encryption
Symmetrical Encryption:
Encryption and decryption use the same key

Secret key Secret key

Plain text Encryption Cipher text Decryption Plain text

Asymmetrical Encryption:
Encryption and decryption use different key, a public key and a private key

Public key Private key

Plain text Encryption Cipher text Decryption Plain text


Cryptography
Caesar Cipher

It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down
the alphabet

Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: X Y Z A B C D E F G H I J K L M N O P Q R S T U V W

Cipher: zlqwhu lv frplqj


Plain: winter is coming
Cryptography

Popular Encryption Algorithms

DES

Triple DES

RSA

BlowFish
Advanced C# Part 1

Caesar cipher exercise

Ahmad Mohey | Full Stack Developer

E-mail : [email protected]
Twitter : ahmadmohey85
Caesar cipher exercise

3 digits shift

Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Assignments

Assignment No.9: (Caesar Cipher App)

• Let user to choose between encryption, decryption or exit the app

Encryption mode Decryption mode Exit mode


✓ Display welcome message ✓ Display welcome message ✓ Display goodbye message
✓ Ask user to enter message to encrypt ✓ Ask user about the file to decrypted
✓ Ask user about the shift ✓ Ask user about the file name
✓ Display the encrypted message ✓ Ask user about the shift
✓ Display the options to the user ✓ Display the decrypted message
✓ Display the options to the user
• All app text should be in green and user’s should be in white.
• Try to catch any error possible like wrong path..etc.
• Error messages should be in red.
Assignments

Assignment No.10: (Caesar Cipher Encrypt Snippet)

• Create snippet to create caesar cipher encryption method.

You might also like