souvikdas95 / NeedhamSchroedar

KDC Implementation using NeedhamSchroedar Protocol - Cybersecurity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NeedhamSchroedar

KDC Implementation using NeedhamSchroedar Protocol - Cybersecurity

Compiling

The following command-line should be used to compile all the 3 files:

#!shell
gcc -O2 -Wall -fPIC aes.c <input> -o <output> -lmcrypt

where, is the source file (Alice.c / Bob.c / KDC.c) is the compiled file

Flow of Operation

protocol_specification

Steps

  1. Alice sends Request to KDC

    This requires the use of a special structure (kdc_request_s) to contain 3 (+1) parameters:

    1. Source (Alice)
    2. Target (Bob)
    3. Source Nonce (R1 or RA) (Generated by Alice)
    4. (Optional) Padding (to match with AES blocksize)

    The same structure is shared with KDC to receive the data in formatted plaintext.

  2. KDC sends Reply to Alice

    This requires the use of a special structure (kdc_reply_s) to contain 4 (+1) parameters:

    1. Source Nonce (R1 or RA)
    2. Target (Bob)
    3. Session Key (KAB) (Generated by KDC)
    4. <encrypted ticket> (Ticket is encrypted using Bob’s key after being generated by KDC)
    5. (Optional) Padding (to match with AES blocksize)

    The same structure is shared with Alice to receive data in ciphertext and decrypt into formatted plaintext.

    The Ticket so encrypted requires an additional structure (ticket_s) to contain 2 parameters:

    1. Source (Alice)
    2. Session Key (KAB)

    The same structure is shared with Bob to receive the data in ciphertext and decrypt into formatted plaintext.

  3. Alice sends Encrypted Ticket to Bob

    This stage simply involves forwarding the received payload from KDC directly to Bob since Alice doesn’t have Bob’s key to decrypt the ticket, to be sent to Bob.

  4. Bob sends Nonce (R2 or RB) to Alice

    1. Bob generates Nonce (R2 or RB).
    2. Then ecrypts it using the Session Key (KAB).
    3. Then sends the ciphertext to Alice which she can easily decrypt using the shared ession Key (KAB).
  5. Alice sends (R2 - 1) to Bob

    1. Alice subtracts 1 from the Nonce (R2 or RB).
    2. Then ecrypts it using the Session Key (KAB).
    3. Then sends the ciphertext to Bob which he can easily decrypt using the shared ession Key (KAB).
    4. Bob simply compares the expected value with the received value.
    5. If confirmed, establishment of the Session by announcing “SUCCESS”

Support Methods:

  1. allocateRandomString()

    Creates a random character string of required length from a chosen charset.

  2. getTimestamp_usec()

    Fetches 64-bit accurate timestamp (in microseconds w/ count from EPOCH)

  3. AES Library Methods

    AES Library Methods such as encrypt() and decrypt() are used.

Screenshot

screenshot


What is this repository for?

  • Quick summary:

    Cybersecurity Assignment Project - Implementation of Needham Schroedar Protocol

How do I get set up?

  • Requirements
    • CC/GCC Toolkit
    • Mcrypt library

Who do I talk to?

About

KDC Implementation using NeedhamSchroedar Protocol - Cybersecurity

License:Apache License 2.0


Languages

Language:C 100.0%