// Decrupting Raw Data Using a Key

    // The DES algorithm requires a trusted source of random bits
    SecureRandom sr = new SecureRandom();

    byte rawKeyData[] = /* get the raw key data from somewhere */;

    // Create a DES key object specification from the raw data
    DESKeySpec dks = new DESKeySpec( rawKeyData );

    // Create a key factory and use it to turn the DESKeySpec into
    // a SecretKey object
    SecretKeyFactory keyFactory = SecretKeyFactory.getInstance( "DES" );
    SecretKey key = keyFactory.generateSecret( dks );

    // The Cipher object does the actual decryption
    Cipher cipher = Cipher.getInstance( "DES" );

    // Initialize the cipher with the key
    cipher.init( Cipher.DECRYPT_MODE, key, sr );

    // Now we'll grab our data and decrypt it
    byte encryptedData[] = /* get from somewhere */

    // The actual decryption step
    byte decryptedData[] = cipher.doFinal( encryptedData );

    // Do something with the decrypted data
    doSomething( decryptedData );