Friday, October 14, 2016

Asymmetric Cryptography

Asymmetric Cryptography

Public Key Cryptosystems rely on a pairs of keys assigned to each user of the cryptosystem.

RSA

  • 1977, Ronald Rivest, Adi Shamir, Leonard Adleman
  • RSA algorithm (Patented) form the backbone of large number of well known security infrastructure



  • Computational difficulty inherent in factoring large prime numbers
  • Each User of the cryptosystem generates a pair of public and private keys using the algorithm below :-
  1. Choose 2 large prime numbers (p and q of 200 digits length each)
  2. compute the product:    n = p * q
  3. Select a number  e such that
    • e < n
    • e and (n-1)(q-1) are relatively prime - that is, the 2 numbers have no common factors other than 1.
  4. Find a number d, such that (ed-1)mod(p-1)(q-1) = 0
  5. Distribute e and n as the public key to all cryptosystem users. Keep d secret as the private key.



    • If Alice wants to send an encrypted message to Bob, she generates the ciphertext (C) from the plain text (P) using the formula (where e is Bob's public and n is the product of p and q created during the key generation process):


    C = P (power e) mod n

    When Bob receives the message, he performs tha following calculation ro retrieve the plaintext message:

    P = C (power d) mod n


    Merkle-Hellman Knapsack

    • 1978
    • Based on the difficulty of performing factoring operations, but it relies on a component of set theory known as super-increasing sets rather than on large prime numbers. Proven ineffective when it was broken in 1984.



    Cryptosystem---------------------Key length
    RSA---------------------1088 bits
    DSA---------------------1024 bits
    Elliptic curve---------------------160 bits






    El Gamal

    • Based on Diffie-Hellman key exchange algorithm
    • Major Disadvantage - the algorithm doubles the length of any message it encrypts.
    • This is a major hardship when encrypting long messages or data that will be transmitted over a narrow bandwidth communications circuit.



    Elliptic Curve

    • 1985
    • Mathematicians - Neal Koblitz abd Victor Miller
    • Elliptic Curve Cryptography (ECC) theory


    y(power 2) = x(power 3) + ax + b

    x,y,a and b are all real numbers





    Hash Functions


    • Take a long potentially long message and generate a unique output value derived from the content of the message.
    • This value is commonly referred as message digest.
    • Most cases, message digest is 128 bits or longer.


    5 basic requirements


    1. Input can be of any length
    2. Output has a fixed length
    3. Hash function os relatively easy to compute
    4. Hash function is one-way . It is extremely hard to determine the input when provided with output
    5. Hash function is collision free (it is externally hard to find two messages that produce the same hash value)



    SHA, SHA-1, SHA-2

    • Government Standard hash functions developed by National Institute of Standard and Technology (NIST)
    • Publication - Secure Hash Standard (SHS) aka Federal Information Processing Standard (FIPS) 180
    • SHA-1 takes Input length upto 2,097,152 terabytes ----> Output 160-bit message digest
    • processes a message in 512-bit blocks
    • therefore it pads the Input message with additional data so that length reaches tge next highest mutiple of 512.


    Recent cryptanalytic attacks demontrated weaknesses in SHA-1

    Four new variants

    1. SHA-256 output 256-bit, 512 bit block size
    2. SHA-224 output 224-bit, 512 bit block size
    3. SHA-512 output 512-bit, 1024 bit block size
    4. SHA-384 output 384-bit, 1024 bit block size




    MD2

    • 1989
    • Ronald Rivest
    • 8-bit processors
    • pads the message with 16 bytes
    • output 16-byte checksum and appends it to the end of the message
    • 128-bit message digest is then generated by using the entire original message along with the appended checksum




    MD4

    • 1990
    • Rivest
    • enhanced the algorithm to support 32-bit processors and increase the level of security
    • It first pads the message to ensure that the message length is 64 bits smaller than a mutiple of 512 bits
    • For example, a 16-bit message will be padded with 432 additional bits of data to make it 448 bits, which is 64 bits smaller than a 512-bit message.
    • MD4 then processes 512-bit blocks in three rounds of computation to produce the message digest of 128-bit 
    • No longer secure


    MD5

    • 1991
    • Rivest
    • Problems again - Slow
    • Subject to collisions



    Hash algorithm chart

    Name--------------------------------------------Hash Value Length
    Hash of Variable Length(HAVAL)-an MD5 variant--------------------------------------------128,160,192,224,256
    Hash Message Authenticating Code(HMAC)--------------------------------------------Variable
    MD2--------------------------------------------128
    MD4--------------------------------------------128
    MD5--------------------------------------------128
    SHA-1--------------------------------------------160
    SHA-224--------------------------------------------224
    SHA-256--------------------------------------------256
    SHA-384--------------------------------------------384
    SHA-512--------------------------------------------512


    Digital Signatures
    Once you have chosen a cryptographically sound hashing algorithm, you can use it to implement a digital signature system.
    2 Distinct Goals

    1. Digitally signed messages assure the recipient that the message truly came from the claimed sender. Nonrepudiation
    2. Digitally signed messages assure the recipient that the message was not altered while in transit between the sender and recipient. 



    Process:-

    1. Alice generates a message digest of the original plaintext message using one of the cryptographically sound hashing algorithms, such as SHA-512.
    2. Alice then encrypts only the message digest using her private key. This is Digital Signature.
    3. Alice appends the signed message digest to the plaintext message.
    4. Alice sends the appended message to Bob.



    Bob reverses the procedure

    1. Bob decrypts the digital signature using Alice's public key,
    2. Bob uses the same hashing function to create a message digest of the full plaintext message received from Alice.
    3. Bob then compares the decrypted message digest he received from Alice with the message digest he computed himself. If the 2 digests match, then he is assured that the message was only sent from Alice and also it was not modified in the transit.

    Digital Signature Standard

    NIST specifies the digital signature algorithms acceptable for federal government use in Federal Information Processing Standard (FIPS) 186-4, aka Digital Signature Standard (DSS)
    1. Digital Signature Algorithm (DSA) as specified in FIPS 186-4
    2. RSA algorithm as specified in ANSI X9.31
    3. Elliptic Curve DSA (ECDSA) as specified in ANSI X9.62

    Wednesday, October 12, 2016

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Disconnected Application Instances, Form & Child Forms

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Disconnected Application Instances, Form & Child Forms

    In this post, I will create a Disconnected Application Instance, Its Form and 1 Child Form.


    Please follow the screenshots below, most of the tasks are self explainatory.


    ------------------------------------------------------------------------------

























































    ----------------------------------------------------------------------------------------------




















































    --------------------------------------------------------------------------------------------






































    -------------------------------------------------------------------------------------------







































    --------------------------------------------------------------------------------------------


































    ----------------------------------------------------------------------------------------------


























































    ---------------------------------------------------------------------------------------------






































    ------------------------------------------------------------------------------------------


























    -------------------------------------------------------------------------------------------



































    --------------------------------------------------------------------------------------------


































    ----------------------------------------------------------------------------------------------
























    -----------------------------------------------------------------------------------------------

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Self Service Capabilities Conditions

    1. changeSelfAccountPassword
    2. modifySelfAccounts
    3. modifySelfEntitlements
    4. selfModifyUser
    5. selfModifyProxyUser
    6. modifySelfRoles
    7. addSelfAccounts
    8. addSelfEntitlements
    9. addSelfRoles
    10. deleteSelfAccounts
    11. deleteSelfEntitlements
    12. deleteSelfRoles

    There is one to one mapping between the cryptic name (above) and condition label image (below)


    Monday, October 10, 2016

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Self-Service Capabilities

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Self-Service Capabilities
    • Oracle Identity Manager allows you to control what operations a user can perform for the self. For example, if a user belongs to a particular organization, then the user is allowed only to change self profile, and other operations in Oracle Identity Manager are restricted. This can be achieved by setting rules in the Self Service Capability Policy. In Self Service Capability Policy, you can define rules based on user attributes. You can set user attributes as denied attributes for the user who satisfies the rule. The user attributes marked as denied attributes cannot be viewed or edited. The return value of this rule is the capability assigned to the user and the denied attributes that are configured. Self Service Capability Policy is seeded with a default rule.


    Default Self Service Capability Rule
    • The Self Service Capability Policy is seeded with a Default Self Service Capability rule. The default condition always evaluates to true. Therefore, if any other rule defined in the Self Service Capability Policy is not satisfied, the default rule is satisfied and provides the user with all the self service capabilities.



    Example of Self Service Capability Rules and Rule Evaluation Order
    • If user type is Contractor, then user is allowed only to manage self profile.
      • If user.Role Equal Contractor THEN capability Equal selfModifyUser


    • If user type is Full Time and belongs to Sales department, then user is allowed to request roles and modify their profiles.
      • If user.Role Equal Full-time AND user.Department Number Equal Sales 
      • THEN 
      • capability Equal addSelfRoles
      • AND 
      • capability Equal selfModifyUser



    Creating a Rule in Self Service Capability Policy
    • Oracle Identity System Administration -> System Configuration -> Self Service Capabilities
    Modifying a Rule in Self Service Capability Policy
    • Oracle Identity System Administration -> System Configuration -> Self Service Capabilities
    Deleting a Rule in Self Service Capability Policy
    • Oracle Identity System Administration -> System Configuration -> Self Service Capabilities -> Delete

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Home Organization Policies

    Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) - Home Organization Policies

    When an user submits a request for self-registration, the home organization of the user gets determined by the home organization policy. The organization name, as determined by the home organization policy, is filled in the request submitted. The approver can override the home organization of the user while approving the request. If a pre-process custom handler is defined to determine the home organization during self-registration, then home organization policy is not evaluated. If workflow policy is defined, then it takes precedence over the home organization policy.


    Features of Home Organization Policy
    During Oracle Identity Manager deployment, a default home organization policy called Home Organization Determination Policy and a default rule called Default All Users To Single Organization is seeded, if not already present. Oracle Identity Manager does not allow you to define new home organization policies. However, new rules can be created under the default home organization policy.




    • Self Registration Use Case Using Default Rule
      • Default rule is named as Default All Users To Single Organization Rule. This rule can be modified but cannot be deleted.
      • The condition defined is:
      • IF user.User Login  Equals  $(user.User Login) THEN organization equals "Xellerate Users"




    • Self Registration Use Case Using Simple Rule
      • A simple rule is a rule created with a single IF condition and with out using any operator like AND/OR.
      • For example, if a rule called ExampleSimpleRule is defined with the following condition:
      • IF user.Nickname Starts with "Test" THEN organization equals "testOrg2"




    • Self Registration Use Case Using Complex Rule
      • A complex rule is a rule created with more than one IF condition and uses AND/OR operators to form the rule.
      • For example, if a rule called ExampleComplexRule is defined with the following condition:
      • IF user.Nickname Starts with "Test" AND user.Display Name Ends with "User" THEN organization equals "testOrg3"




    • Rule Evaluation Order
      • When a user self registers, the first rule that is evaluated is the top rule on the list that appears on the home organization page, followed by the next rule up to the last rule. Evaluation stops as soon as a match is found. 



    • Self Registration Use Case When SOA is OFF
      • When SOA is off, and a self registration request is submitted, then the request gets auto-approved and status of request is shown as completed.




    Creating a Rule in Home Organization Policy

    • System Administration -> System Configuration -> Home Organization Policy



    Modifying a Rule in Home Organization Policy

    • System Administration -> System Configuration -> Home Organization Policy



    Deleting a Rule in Home Organization Policy

    • System Administration -> System Configuration -> Home Organization Policy -> Delete