Tải bản đầy đủ (.pdf) (42 trang)

Session 06 kho tài liệu bách khoa

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.73 MB, 42 trang )

Advanced Windows Store Apps Development – II


 Explain the process of encrypting and decrypting user information.
 Explain and create an app using the Windows.Security.Cryptography.

© Aptech Ltd.

Securing Windows Store App Data/Session 6

2


A Windows Store app needs to store application and user data. Application data is
the information about the app that can be created, modified, or deleted. To assist
developers, the user has to develop safer apps with secured features. The security
features offered to the developers by Windows Store are as follows:
App sandbox - Provides a secure runtime engine that executes the app with a
potential container. This sandbox avoids direct communications between Store apps
and the system. The sandbox is a secured environment, which allows your app
specific rights and allows it execute the code.
App capabilities - All the apps have their own device capabilities, for example,
Documents Library or Webcam.
Digital signature - All apps are signed. The apps are signed spontaneously through
certificate that is associated with the developer account or manually using their own
certificate.

© Aptech Ltd.

Securing Windows Store App Data/Session 6


3


Windows.Security.Cryptography Namespaces
This Windows.Security.Cryptography has a class that is used to encode or decode,
hashing random numbering, byte arrays, and buffer conversion.
Cryptography is used for:
 Authentication
 Confidentiality
 Data integrity
 Nonrepudiation
Following table shows all the classes that can be used to encrypt and decrypt the data.
Cryptography namespaces hold the methods given in this table.
Term

Description

Encryption

Encrypts the app data

Decryption

Decrypts the app data

© Aptech Ltd.

Securing Windows Store App Data/Session 6

4



Term

Description

Plaintext

Data without encryption (unencrypted data)

Cipher text

Encrypted data with unreadable, text message

Hashing

Converting variable length data into a fixed length

Signature

Encrypted hash of digital data

Algorithm

Procedure for encrypting data

Key

A random or pseudorandom


Symmetric Key Cryptography

Same key is used for encryption and decryption

Asymmetric Key
Cryptography

Public key and Private key algorithm, where one key is
used for encryption and the other key is used for
decryption of data. These keys are mathematically
related keys

Encoding

Encoding digital messages

Algorithm Provider

A DLL that implements a cryptographic algorithm

© Aptech Ltd.

Securing Windows Store App Data/Session 6

5


Encrypting File System (EFS) and BitLocker

 Encrypting File System (EFS) is a feature of Windows that can be used to store data on

hard disk in an encrypted format.
 It is the strongest protection used to secured data in Windows.
 BitLocker Disk Encryption (BDE) is an encryption algorithm that was introduced by
Microsoft with Windows Vista and Windows 7.
 It is used to encrypt entire disk drive. It is designed to protect the entire volume.
 There are some differences in BDE and EFS encryption algorithms.
 In order to understand the comparisons between the BitLocker and EFS, it is necessary to
understand the difference between these encryption algorithms.

© Aptech Ltd.

Securing Windows Store App Data/Session 6

6


Table provides the differences between BitLocker and Encrypting File System.

BitLocker

Encrypting File System (EFS)

Encrypts all personal and system files

Encrypts personal files and folders oneby-one

Does not depend on the individual user Depends on the user account
accounts
BitLocker
Module


uses

the

Trusted

Platform EFS does
hardware

not

require

or

use

any

Device administrator is required to turn Device administrator is not required to
encryption on or off the device
turn encryption on or off the device

© Aptech Ltd.

Securing Windows Store App Data/Session 6

7



Setting UAC Prompts
User Account Control (UAC) can help users prevent unauthorized changes to the settings. UAC
notifies the user whenever changes are going to be made. These types of changes can affect
the sf16LE, resultBuffer);
return result;
}

© Aptech Ltd.

Securing Windows Store App Data/Session 6

30


Data Encryption and Decryption

Step 1: Create new project from File  New Project.
Step 2: Write the code given in Code Snippet to design the UI page.

Code Snippet:
x:Class=”EncryptDecryptDemo.MainPage”
xmlns=” />xmlns:x=” />xmlns:local=”using:EncryptDecryptDemo”
xmlns:d=” />xmlns:mc=” />mc:Ignorable=”d”>
<Grid Background=”{ThemeResource ApplicationPageBackgroundThemeBrush}”>
Text=”Plain Text” VerticalAlignment=”Top” Margin=”158,234,0,0”/>

© Aptech Ltd.


Securing Windows Store App Data/Session 6

31


Code Snippet (Cont.):
FontSize=”20” VerticalAlignment=”Top” Margin=”329,229,0,0” Width=”907”/>
Text=”Encrypted Value” VerticalAlignment=”Top” Margin=”158,315,0,0”/>
TextWrapping=”Wrap” FontSize=”20” VerticalAlignment=”Top”
Margin=”329,314,0,0” Width=”907”/>
Text=”Decrypted Value” VerticalAlignment=”Top” Margin=”158,403,0,0”/>
TextWrapping=”Wrap” FontSize=”20” VerticalAlignment=”Top”
Margin=”329,402,0,0” Width=”907”/>

×