Dienstag, 27. Januar 2015

Virtual private networks

(see http://en.wikipedia.org/wiki/Virtual_private_network)

First watch the video at https://www.youtube.com/watch?v=4BfL0UHrzDY&spfreload=10. Afterwards please answer the following questions:

What is a VPN used for?

A Virtual Private Network (VPN) is a network technology that creates a secure network connection over a public network such as the Internet or a private network owned by a service provider. Large corporations, educational institutions, and government agencies use VPN technology to enable remote users to securely connect to a private network.

A VPN can connect multiple sites over a large distance just like a Wide Area Network (WAN). VPNs are often used to extend intranets worldwide to disseminate information and news to a wide user base. Educational institutions use VPNs to connect campuses that can be distributed across the country or around the world.

In order to gain access to the private network, a user must be authenticated using a unique identification and a password. An authentication token is often used to gain access to a private network through a personal identification number (PIN) that a user must enter. The PIN is a unique authentication code that changes according to a specific frequency, usually every 30 seconds or so.


Which types of VPNs are used?

There are three kinds of virtual private networks (VPNs). The most common ones are remote access VPNs or virtual private dial-up networks (VPDNs). These are user-to-LAN connections used when employees of a company who are in remote locations need to connect to the company's private network. A company that wants to set up a remote-access VPN usually outsources to an ESP or enterprise service provider. The ESP sets up a NAS (network access server) and also provides remote users with the software they need for their computers. Then users simply dial the NAS using a toll-free number and access the network via their VPN client software. VPNs offer a good third-party service for encrypted, secure connections between remote users within a private network.

The other two types of VPN are both site-to-site, meaning that multiple fixed sites are connected over a public network (like the Internet). A site-to-site VPN requires large-scale encryption and dedicated equipment. An intranet (password-protected site for company employees)-based VPN connects LAN to LAN when a company wants to connect multiple remote connections in one private network. An extranet-based VPN connects LAN to LAN between multiple companies (such as customers and suppliers) so that they can work in a shared environment.


How did VPNs evolve?

Many organisations today operate in complex, distributed environments that encompass multiple branch offices spread across diverse geographical locations, some of which may be subsidiaries or affiliated companies. For most of these, access to centralised IT resources is a must. And they also need to provide access to those IT resources for an expanding army of mobile workers and for external users. Remote access has become a fact of life.

To provide secure remote access to employees - and increasingly to business partners, suppliers and users - virtual private networks (VPN) have emerged as the technology of choice. The majority of VPN deployments are one of two flavours. Secure socket layer (SSL) VPNs require just an internet browser for setting up a VPN connexion and are an effective remote access solution for large numbers of remote and ad hoc users.


What made VPNs possible?

As the public networks evolved, also VPNs became more important. VPNs bring the possibility to get a private connection over a public network.


What are the components of a VPN? How do they work together? Explain that in more detail.


  • VPN server: A computer that accepts VPN connections from VPN clients. 
  • VPN client: A computer that initiates a VPN connection to a VPN server. A VPN client can be an individual computer or a router.
  • Tunnel: The portion of the connection in which your data is encapsulated.
  • VPN connection: The portion of the connection in which your data is encrypted. For typical secure VPN connections, the data is encrypted and encapsulated along the same portion of the connection.
  • Tunneling protocols: Protocols that are used to manage tunnels and encapsulate private data. Data that is tunneled must also be encrypted to be a VPN connection. The Windows Server 2003 family includes the PPTP and L2TP tunneling protocols. For more information, see Point-to-Point Tunneling Protocol and Layer Two Tunneling Protocol.
  • Tunneled data: Data that is usually sent across a private point-to-point link.
  • Transit internetwork: The shared or public network crossed by the encapsulated data. For the Windows Server 2003 family, the transit internetwork is always an IP internetwork. The transit internetwork can be the Internet or a private IP-based intranet.

Quelle: https://i-msdn.sec.s-msft.com/dynimg/IC197655.gif


What is tunneling?

Virtual private network technology is based on the idea of tunneling.
VPN tunneling involves establishing and maintaining a logical network connection (that may contain intermediate hops). On this connection, packets constructed in a specific VPN protocol format are encapsulated within some other base or carrier protocol, then transmitted between VPN client and server, and finally de-encapsulated on the receiving side. For Internet-based VPNs, packets in one of several VPN protocols are encapsulated within Internet Protocol (IP) packets. VPN protocols also support authentication and encryption to keep the tunnels secure.


Which algorithms are used for encrpyting the packets?


A data packet can only be sent if the encryption key is known to both parties, and the connection is activated. If the encryption key is not known, a request is sent to the destination using the meta connection to retrieve it.

So, the entire VPN packet is encrypted using a symmetric cipher, including a 32 bits sequence number that is added in front of the actual VPN packet, to act as a unique IV for each packet and to prevent replay attacks. A message authentication code is added to the UDP packet to prevent alteration of packets. Tinc by default encrypts network packets using Blowfish with 128 bit keys in CBC mode and uses 4 byte long message authentication codes to make sure eavesdroppers cannot get and cannot change any information at all from the packets they can intercept. The encryption algorithm and message authentication algorithm can be changed in the configuration. The length of the message authentication codes is also adjustable. The length of the key for the encryption algorithm is always the default length used by OpenSSL.




Which VPN protocols are used very often in industry?


  • OpenVPN
  • PPTP
  • Chameleon
  • L2TP/IPsec
  • SSL with encryption
  • MPLS with constrained distribution of routing information through BGP


What is a split tunnel?

Split tunneling is a computer networking concept which allows a VPN user to access a public network (e.g., the Internet) and a local LAN or WAN at the same time, using the same physical network connection. This connection service is usually facilitated through a program such as a VPN client software application.
For example, suppose a user utilizes a remote access VPN software client connecting to a corporate network using a hotel wireless network. The user with split tunneling enabled is able to connect to file servers, database servers, mail servers and other servers on the corporate network through the VPN connection. When the user connects to Internet resources (Web sites, FTP sites, etc.), the connection request goes directly out the gateway provided by the hotel network.


Explain in short how OpenVPN and IPSec work and which components do they consist of?


OpenVPN:
OpenVPN is an open-source software application that implements virtual private network (VPN) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (NATs) and firewalls. It was written by James Yonan and is published under the GNU General Public License (GPL).

OpenVPN allows peers to authenticate each other using a pre-shared secret key, certificates, or username/password. When used in a multiclient-server configuration, it allows the server to release an authentication certificate for every client, using signature and Certificate authority. It uses the OpenSSL encryption library extensively, as well as the SSLv3/TLSv1 protocol, and contains many security and control features.

OpenVPN has been ported and embedded to several systems. For example, DD-WRT has the OpenVPN server function. SoftEther VPN, a multi-protocol VPN server, has an implementation of OpenVPN protocol.



IPSec:
IPSec is an Internet Engineering Task Force (IETF) standard suite of protocols that provides data authentication, integrity, and confidentiality as data is transferred between communication points across IP networks. IPSec provides data security at the IP packet level. A packet is a data bundle that is organized for transmission across a network, and it includes a header and payload (the data in the packet). IPSec emerged as a viable network security standard because enterprises wanted to ensure that data could be securely transmitted over the Internet. IPSec protects against possible security exposures by protecting data while in transit.


Quellen:
http://whatismyipaddress.com/vpn
http://computer.howstuffworks.com/three-types-of-vpn.htm
http://technet.microsoft.com/en-us/library/cc786563%28v=ws.10%29.aspx
http://compnetworking.about.com/od/vpn/a/vpn_tunneling.htm
http://www.tinc-vpn.org/documentation-1.1/Encryption-of-network-packets.html
http://documentation.netgear.com/reference/enu/vpn/VPNBasics-3-02.html

Pretty Good Privacy (PGP) / GNU Privacy Guard(GPG)

see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
and http://en.wikipedia.org/wiki/GNU_Privacy_Guard

What is PGP?

Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication. PGP is often used for signing, encrypting, and decrypting texts, e-mails, files, directories, and whole disk partitions and to increase the security of e-mail communications. It was created by Phil Zimmermann in 1991 while working at PKWARE, Inc.

PGP and similar software follow the OpenPGP standard (RFC 4880) for encrypting and decrypting data.


What is PGP mainly used for?

Pretty Good Privacy can be used to authenticate digital certificates and encrypt/decrypt texts, emails, files, directories and whole disk partitions. Symantec, for example, offers PGP-based products such as Symantec File Share Encryption for encrypting files shared across a network and Symantec Endpoint Encryption for full disk encryption on desktops, mobile devices and removable storage. In the case of using PGP technology for files and drives instead of messages, the Symantec products allows users to decrypt and re-encrypt data via a single sign-on.


How does PGP work?

Quelle: http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/PGP_diagram.svg/1024px-PGP_diagram.svg.png


What is the web of trust?

Scematic representation of an web of trust:

Quelle: http://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Web_of_Trust_2.svg/800px-Web_of_Trust_2.svg.png



How and why are certificates used? What is a certificate good for?


In the (more recent) OpenPGP specification, trust signatures can be used to support creation of certificate authorities. A trust signature indicates both that the key belongs to its claimed owner and that the owner of the key is trustworthy to sign other keys at one level below their own. A level 0 signature is comparable to a web of trust signature since only the validity of the key is certified. A level 1 signature is similar to the trust one has in a certificate authority because a key signed to level 1 is able to issue an unlimited number of level 0 signatures. A level 2 signature is highly analogous to the trust assumption users must rely on whenever they use the default certificate authority list (like those included in web browsers); it allows the owner of the key to make other keys certificate authorities.


What's the difference between PGP and GPG?

“PGP” stands for “Pretty Good Privacy.” It was developed by Phil Zimmermann. At first it was written as copyrighted freeware under the Gnu Public License. Later, PGP was upgraded and made into a propriety program. The rights for this program are traded around. The reason for this upgrade was legal defense costs and royalty issues related to the export laws of the USA. Now the PGP program is owned by PGP Corporation.

“GPG” stands for “Gnu Privacy Guard.” GPG is a re-write or upgrade of PGP. It does not use the IDEA encryption algorithm. This is to make it completely free. It uses the NIST AES, Advanced Encryption Standard. All the algorithm data is stored and documented publicly by OpenPGP Alliance. The main reason for this change is that AES costs less than IDEA and is considered more secure. Moreover, it is royalty free because it is not patented. GPG is more compatible than the original PGP with OpenPGP. GPG is also based on a command line. Windows frontends are also available for GPG other than the command line.


Which other methods can be used to encrypt E-Mails (see http://en.wikipedia.org/wiki/Email_encryption)?

  • Enigmail - Thunderbird plug-in
  • Entrust
  • Echoworx
  • Email authentication
  • Email privacy
  • Galaxkey - iOS, Android, Windows,BlackBerry and outlook plug-in
  • GPGMail - OS X Mail.app plug-in
  • MyKolab
  • Secure Messaging
  • Dark Mail Alliance
  • HTTP Secure - a widely used communications protocol for secure communication over a computer network
  • Hushmail
  • Lavabit
  • Mail1Click
  • DataMotion, Inc.


How can PGP/GPG be used in popular E-Mail services (gmail, yahoo-mail, outlook)?

To use PGP, you will need to install some extra software that will work with your current email program. You will also need to create a private key, which you will keep private. The private key is what you will use to decrypt emails sent to you, and to digitally sign emails that you send to show they truly came from you. Finally, you'll learn how to distribute your public key—a small chunk of information that others will need to know before they can send you encrypted mail, and that they can use to verify emails you send.


Quellen: http://en.wikipedia.org/wiki/Pretty_Good_Privacy
http://en.wikipedia.org/wiki/GNU_Privacy_Guard
http://searchsecurity.techtarget.com/definition/Pretty-Good-Privacy


Digital Signiture

see http://en.wikipedia.org/wiki/Digital_signature

Please answer the following questions:


What is authentication and integrity?

Authentication:
Although messages may often include information about the entity sending a message, that information may not be accurate. Digital signatures can be used to authenticate the source of messages. When ownership of a digital signature secret key is bound to a specific user, a valid signature shows that the message was sent by that user. The importance of high confidence in sender authenticity is especially obvious in a financial context. For example, suppose a bank's branch office sends instructions to the central office requesting a change in the balance of an account. If the central office is not convinced that such a message is truly sent from an authorized source, acting on such a request could be a grave mistake.

Integrity:
In many scenarios, the sender and receiver of a message may have a need for confidence that the message has not been altered during transmission. Although encryption hides the contents of a message, it may be possible to change an encrypted message without understanding it. (Some encryption algorithms, known as nonmalleable ones, prevent this, but others do not.) However, if a message is digitally signed, any change in the message after signature invalidates the signature. Furthermore, there is no efficient way to modify a message and its signature to produce a new message with a valid signature, because this is still considered to be computationally infeasible by most cryptographic hash functions (see collision resistance).


What are the applications of digital signatures, when are they used?

A digital signature can be used with any kind of message -- whether it is encrypted or not -- simply so the receiver can be sure of the sender's identity and that the message arrived intact. Digital signatures make it difficult for the signer to deny having signed something (non-repudiation) -- assuming their private key has not been compromised -- as the digital signature is unique to both the document and the signer, and it binds them together. A digital certificate, an electronic document that contains the digital signature of the certificate-issuing authority, binds together a public key with an identity and can be used to verify a public key belongs to a particular person or entity.

Most modern email programs support the use of digital signatures and digital certificates, making it easy to sign any outgoing emails and validate digitally signed incoming messages. Digital signatures are also used extensively to provide proof of authenticity, data integrity and non-repudiation of communications and transactions conducted over the Internet.

Digital signatures are often used to implement electronic signatures, a broader term that refers to any electronic data that carries the intent of a signature, but not all electronic signatures use digital signatures.In some countries, including the United States, India, Brazil, and members of the European Union, electronic signatures have legal significance.


How do they work, how is message signed and verified?


Quelle: http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Digital_Signature_diagram.svg/1280px-Digital_Signature_diagram.svg.png


What is the hash of a message? Which hash functions are the most popular ones?
What's the difference to an electronic signature?

Producing hash values for accessing data or for security. A hash value (or simply hash), also called a message digest, is a number generated from a string of text. The hash is substantially smaller than the text itself, and is generated by a formula in such a way that it is extremely unlikely that some other text will produce the same hash value.
Hashes play a role in security systems where they're used to ensure that transmitted messages have not been tampered with. The sender generates a hash of the message, encrypts it, and sends it with the message itself. The recipient then decrypts both the message and the hash, produces another hash from the received message, and compares the two hashes. If they're the same, there is a very high probability that the message was transmitted intact.
Hashing is also a common method of accessing data records. Consider, for example, a list of names:


  • John Smith
  • Sarah Jones
  • Roger Adams


To create an index, called a hash table,for these records, you would apply a formula to each name to produce a unique numeric value. So you might get something like:


  • 1345873 John smith
  • 3097905 Sarah Jones
  • 4060964 Roger Adams


Then to search for the record containing Sarah Jones,you just need to reapply the formula, which directly yields the index key to the record. This is much more efficient than searching through all the records till the matching record is found.

Quelle: http://www.webopedia.com/TERM/H/hashing.html



Name some digital signature algorithms:


  • Pairing-based schemes such as BLS
  • Undeniable signatures
  • Rabin signature algorithm
  • cryptographic protocols such as zero-knowledge proofs or secure c
  • DSA and its elliptic curve variant ECDSA
  • Aggregate signature
  • RSA-based signature schemes, such as RSA-PSS
  • ElGamal signature scheme as the predecessor to DSA, and variants Schnorr signature and Pointcheval–Stern signature algorithm


Which additional security precautions can be used?


  • Putting the private key on a smart card
  • Using smart card readers with a separate keyboard
  • Other smart card designs
  • Using digital signatures only with trusted applications
  • Using a network attached hardware security module



Quelle: http://en.wikipedia.org/wiki/Digital_signature#Authentication
http://en.wikipedia.org/wiki/Digital_signature
http://www.webopedia.com/TERM/H/hashing.html
http://searchsecurity.techtarget.com/definition/digital-signature



Diffie–Hellman key exchange

(see also on http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange)

Please watch the following video under http://www.youtube.com/watch?v=YEBfamv-_do and give answers to the following questions:


What's the purpose of this algorithm, when is it used?
This algorythm allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communications channel. The key can be used to encrypt subsequent communications using a symmetric key cipher.

What is a one way function?
The one way function is easy to perform but hard to reverse.


Quelle: http://www.cs.cornell.edu/courses/cs513/2007fa/TL01.one-way.png

How does the algorithm work?
Quelle: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkUGnMgfk2C3Vt_pHSETdCRFhdlZ9r5bMvGIALosi8XWii94F8sDQDLP_wk40XwO5yqsItDNQ7N0zastpfblYI17k-gDxCRR6opNOHazh1ql3IGe-y0pDZQFyKhbRkl2U2s2o7mzOcTOY/s1600/Unbenannt.PNG


What is clock arithmetic, which characteristics does it have?

In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" upon reaching a certain value - the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801.

A familiar use of modular arithmetic is in the 12-hour clock, in which the day is divided into two 12-hour periods. If the time is 7:00 now, then 8 hours later it will be 3:00. Usual addition would suggest that the later time should be 7 + 8 = 15, but this is not the answer because clock time "wraps around" every 12 hours; in 12-hour time, there is no "15 o'clock". Likewise, if the clock starts at 12:00 (noon) and 21 hours elapse, then the time will be 9:00 the next day, rather than 33:00. Since the hour number starts over after it reaches 12, this is arithmetic modulo 12. According to the definition below, 12 is congruent not only to 12 itself, but also to 0, so the time called "12:00" could also be called "0:00", since 12 is congruent to 0 modulo 12.



What is the discrete logarithm problem?

Discrete logarithms are logarithms defined with regard to multiplicative cyclic groups. If G is a multiplicative cyclic group and g is a generator of G, then from the definition of cyclic groups, we know every element h in G can be written as gx for some x. The discrete logarithm to the base g of h in the group G is defined to be x . For example, if the group is Z5*, and the generator is 2, then the discrete logarithm of 1 is 4 because 24 ≡ 1 mod 5.

 The discrete logarithm problem is defined as: given a group G, a generator g of the group and an element h of G, to find the discrete logarithm to the base g of h in the group G. Discrete logarithm problem is not always hard. The hardness of finding discrete logarithms depends on the groups. For example, a popular choice of groups for discrete logarithm based crypto-systems is Zp* where p is a prime number. However, if p−1 is a product of small primes, then the Pohlig–Hellman algorithm can solve the discrete logarithm problem in this group very efficiently. That's why we always want p to be a safe prime when using Zp* as the basis of discrete logarithm based crypto-systems. A safe prime is a prime number which equals 2q+1 where q is a large prime number. This guarantees that p-1 = 2q has a large prime factor so that the Pohlig–Hellman algorithm cannot solve the discrete logarithm problem easily. Even p is a safe prime, there is a sub-exponential algorithm which is called the index calculus. That means p must be very large (usually at least 1024-bit) to make the crypto-systems safe.
Quelle: http://www.doc.ic.ac.uk/~mrh/330tutor/ch06s02.html


Calculate the private shared key, when Alice selects 56 and Bob selects 23 as a random number.
What is authentication? Does the Diffie-Hellman key exchange provide authentication?

Firstly you have to agree on a prime modulus and a generic. For example we can choose 5 as the prime modulus and 17 as generic.

Both parties can generate the private shared key with their random number.

556 mod 17 = 16

523 mod 17 = 10

So the private shard keys are 16 and 11.


Elliptic Curve Cryptography

"Die Nationale Sicherheitsbehörde der USA empfahl im Januar 2009, Verschlüsselung im Internet bis 2020 von RSA auf ECC (Elliptic Curve Cryptography) umzustellen."

http://de.wikipedia.org/wiki/Elliptische_Kurve#Anwendung_in_der_Kryptographie
Beantworten Sie mithilfe von

http://de.wikipedia.org/wiki/Elliptische_Kurve und http://de.wikipedia.org/wiki/Elliptic_Curve_Cryptography die folgenden Fragen:


Skizzierte Funktionsweise:
Quelle: https://blog.cloudflare.com/content/images/image02.gif



Wo wird Elliptic Curve Cryptography heutzutage eingesetzt?


  • Bürgerkarten in Österreich (e-card, Bankomat- oder asign Premium Karte) verwenden ECC seit 2004/05
  • Europäische Reisepässe verwenden ECC
  • Windows (ab Vista) unterstützt Elliptic Curve Cryptography
  • Produkte von Mozilla (Firefox, Thunderbird) unterstützen ECC

Welche Vorteile gibt es gegenüber dem RSA-Kryptosystem?


  • CPU Auslastung ist geringer
  • hohe Geschwindigkeit
  • gilt langfristig als sicher
  • hohe Effizienz und Flexibilität
  • Kurze Schlüssel die genauso sicher sind wie die langen Schlüssel bei RSA
  • Benötigter Speicher ist geringer
  • hohe kryptographische Sicherheit relativ zur Schlüssellänge
  • geringe Speicheranforderungen
  • kürzere Signaturen
  • Kostenersparnis

Quellen: http://de.wikipedia.org/wiki/Elliptic_Curve_Cryptography