Adding Encrypted IP Cores Standalone Modelsim

Hello,
I realise this was covered here:
http://forums.xilinx.com/t5/Simulation-and-Verification/modelsim-simulation-of-Vivado-encrypted-IP/td-p/330391
but I still can't get it to work.
I have these libraries included:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_misc.ALL;
LIBRARY unisim;
USE unisim.VComponents.ALL;
And this is the block I'm trying to use:
dsp: entity work.dsp_c -- a*b+c, 12bit
port map
clk => clk_i,
a => a_dsp,
b => b_dsp,
c => c_dsp,
p => p_dsp -- full precision
I went into vivado in tcl mode and got it to compile, it created a dsp_c folder:
dsp_c.dcp dsp_c_funcsim.vhdl dsp_c_stub.v dsp_c.xci synth xbip_dsp48_wrapper_v3_0 xbip_utils_v3_0
dsp_c_funcsim.v dsp_c_ooc.xdc dsp_c_stub.vhdl dsp_c.xml xbip_dsp48_macro_v3_0 xbip_pipe_v3_0
I have a tcl script which looks like this, it fails on mydsp_c.vhd saying:
source firmware/cfg/lib_mappings.tcl
vlib work
vcom firmware/hdl/mydsp_c.vhd
It compains saying it can't find the dsp block, so I added:
src dsp_c/dsp_c.vhd
Throws up this error:
dsp_c/dsp_c.vhd(56): Library xbip_dsp48_macro_v3_0 not found.
Tried sourcing the libraries:
src dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0_vh_rfs.vhd
src dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0.vhd
Tells me they are protected:
dsp_c/xbip_dsp48_macro_v3_0/hdl/xbip_dsp48_macro_v3_0.vhd(46)): in protected region.
That's when I stumbled across that forum post above.
I tried the method in the post before whereby you try a vmap, my tcl script now looks like this:
vlib work
vlib dsp_c/xbip_dsp48_macro_v3_0
vmap dsp_c/xbip_dsp48_macro_v3_0
# do mkProject.tcl
# Modifying modelsim.ini
# ** Warning: (vlib-34) Library already exists at "work".
# ** Warning: (vlib-34) Library already exists at "dsp_c/xbip_dsp48_macro_v3_0".
# Reading modelsim.ini
# "dsp_c/xbip_dsp48_macro_v3_0" maps to directory ./dsp_c/xbip_dsp48_macro_v3_0. (Default mapping)
# -- Loading package NUMERIC_STD
# ** Error: firmware/cgn/dsp_c/dsp_c.vhd(56): Library xbip_dsp48_macro_v3_0 not found.
# ** Error: firmware/cgn/dsp_c/dsp_c.vhd(57): (vcom-1136) Unknown identifier "xbip_dsp48_macro_v3_0".
# ** Error: firmware/cgn/dsp_c/dsp_c.vhd(59): VHDL Compiler exiting
# ** Error: vcom failed.
Any ideas? I feel like I am almost there - or can you not launch a standalone version of modelsim (I can launch this project via Vivado but for various reasons I can't do this in the longterm).
 

I did this and the scripts weren't useful for within my current simulation framework. One of the reaosns being our ethernet IPs are real for the Vivado project and they use dumy ones for our simulation system.
One quick question - what is the difference between Vivado launching modelsim and launching a precompiled version of modelsim? My boss told me something about the Vivado launching method is time driven - so it knows what happenes at exactly what time according to the chip. Our method which he says is older, doesn't care about chip time and hence is much faster. 

Similar Messages

  • Unable to encrypt the Core Storage logical volume

    What's going on here?
    dmd@lumen ~ $ diskutil cs encryptVolume 1C8F9744-6E91-4915-B9E1-6BDA6B4D2A9F
    New passphrase for existing volume:
    Confirm new passphrase:
    Started CoreStorage operation on disk3 megafauna
    Scheduling encryption of Core Storage Logical Volume
    Error: -69694: Unable to encrypt the Core Storage logical volume
    Underlying error: -536870212: Unknown error: -536870212
    Here is the relevant volume information:
        +-> Logical Volume Family D556AA79-22D7-49A4-8ADD-8028F0646060
            Encryption Status:       Unlocked
            Encryption Type:         None
            Conversion Status:       NoConversion
            Conversion Direction:    -none-
            Has Encrypted Extents:   No
            Fully Secure:            No
            Passphrase Required:     No
            |
            +-> Logical Volume 1C8F9744-6E91-4915-B9E1-6BDA6B4D2A9F
                Disk:               disk3
                Status:             Online
                Size (Total):       1149639159808 B (1.1 TB)
                Size (Converted):   -none-
                Revertible:         No
                LV Name:            megafauna
                Volume Name:        megafauna
                Content Hint:       Apple_HFS

    Huh. Well, maybe that's why.
    It was certainly happy enough to let me MAKE a LVG with multiple LVFs. Do you mean it just doesn't support encryption on a LVG with multiple LVFs?
    +-- Logical Volume Group 736244AD-CDF2-4846-9343-2E2A4D487434
        =========================================================
        Name:         seagate1.5TDiskLVG
        Status:       Online
        Size:         1499957936128 B (1.5 TB)
        Free Space:   0 B (0 B)
        |
        +-< Physical Volume E3B2A090-0BD7-433B-BDEA-7B19174FBAB1
        |   ----------------------------------------------------
        |   Index:    0
        |   Disk:     disk2s2
        |   Status:   Online
        |   Size:     1499957936128 B (1.5 TB)
        |
        +-> Logical Volume Family 55E5E43A-8EC9-4760-8F42-1B4AF17F3184
        |   ----------------------------------------------------------
        |   Encryption Status:       Unlocked
        |   Encryption Type:         AES-XTS
        |   Conversion Status:       Converting
        |   Conversion Direction:    forward
        |   Has Encrypted Extents:   Yes
        |   Fully Secure:            No
        |   Passphrase Required:     Yes
        |   |
        |   +-> Logical Volume E0C47F65-A93B-4C33-B915-F33760A75716
        |       ---------------------------------------------------
        |       Disk:               disk4
        |       Status:             Online
        |       Size (Total):       350000001024 B (350.0 GB)
        |       Size (Converted):   211705397248 B (211.7 GB)
        |       Revertible:         No
        |       LV Name:            bonzai
        |       Volume Name:        bonzai
        |       Content Hint:       Apple_HFS
        |
        +-> Logical Volume Family D556AA79-22D7-49A4-8ADD-8028F0646060
            Encryption Status:       Unlocked
            Encryption Type:         None
            Conversion Status:       NoConversion
            Conversion Direction:    -none-
            Has Encrypted Extents:   No
            Fully Secure:            No
            Passphrase Required:     No
            |
            +-> Logical Volume 1C8F9744-6E91-4915-B9E1-6BDA6B4D2A9F
                Disk:               disk3
                Status:             Online
                Size (Total):       1149639159808 B (1.1 TB)
                Size (Converted):   -none-
                Revertible:         No
                LV Name:            megafauna
                Volume Name:        megafauna
                Content Hint:       Apple_HFS

  • Adding Supported Libraries in standalone-derived OS.

    Hi All,
    I am creating a derived OS package from the standalone BSP.
    The overall BSP tree is created and builds fine. I get all expected standalone BSP files plus the OS files on top of it.
    The problem is that in the BSP settings Dialog, I don't get to pick any of the Supported Libraries (xilfatfs, xilflash, etc.)
    I see in the .mld files of these individual libraries that this line is set:
    OPTION REQUIRES_OS = (standalone xilkernel);
    I would have expected a custom BSP that depends on standalone BSP would qualify as a "standalone" OS (like a base object in OO analogy). But it seems not. Or else I am missing the spot.
    Is there a way to be able to add Supported Libraries for a custom OS, without editing the .mld files of the said libs? I want to avoid touching the installation files.
    I am new to this so thanks for any help.
    Regards,
    --Martin

    I did this and the scripts weren't useful for within my current simulation framework. One of the reaosns being our ethernet IPs are real for the Vivado project and they use dumy ones for our simulation system.
    One quick question - what is the difference between Vivado launching modelsim and launching a precompiled version of modelsim? My boss told me something about the Vivado launching method is time driven - so it knows what happenes at exactly what time according to the chip. Our method which he says is older, doesn't care about chip time and hence is much faster. 

  • Failure adding GUI to Core

    I've tried a few different methods I've seen posted to add a GUI to my Server 2012 Core install. Unfortunately, it always fails after the reboot. It will say that it's adding features and get to 99% complete then fail and revert to the previous (Core) settings.
    I have no experience with Core and don't know where to even begin looking into the cause of this problem.

    Thanks, I did find that page when I first started trying to go from Core to the Full install. The steps detailed there are what got me as far as I've been so far. Something is failing when I run ServerCore-FullServer command though. Without the FullServer
    feature in the command, the Gui features succeed. When running the FullServer alone with the others though, it gets all the way to 99% complete then stops.
    I'm just going back there to rebuild it. This has been going on for a while, I simply haven't had time to work on it and now it's eating up my Saturday :D

  • Encrypt webservice example won't run on 8.1beta

    I downloaded the webservice encrypt example and installed per the directions.
    However, when attempting to run the client. I am getting this error...
    Buildfile: build.xml
    run:
    [java] <Jul 2, 2003 8:59:57 AM EDT> <Info> <webservice> <BEA-220024> <Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its
    handleRequest method. The exception was:
    [java] weblogic.xml.security.SecurityConfigurationException: Failed adding
    encryption to request - with nested exception:
    [java] [weblogic.xml.security.SecurityProcessingException: Problem adding
    encrypted key - with nested exception:
         [java] java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException:
    Failed adding encryption to request; nested exception is:
    [java]      javax.xml.rpc.soap.SOAPFaultException: Failed adding encryption to
    request
    [java] [weblogic.xml.security.encryption.EncryptionException: http://www.w3.org/2001/04/xmlenc#tripledes-cbc
    can only be used with a domestic license]].>
    [java]      at sign.SecurityPort_Stub.echo(SecurityPort_Stub.java:30)
    [java]      at sign.SecureClient.main(SecureClient.java:63)
    [java] Caused by: javax.xml.rpc.soap.SOAPFaultException: Failed adding encryption
    to request
    [java]      at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:270)
    [java]      at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:131)
    [java]      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:430)
    [java]      at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:416)
    [java]      at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:275)
    [java]      at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:250)
    [java]      at sign.SecurityPort_Stub.echo(SecurityPort_Stub.java:27)
    [java]      ... 1 more
    [java] Exception in thread "main"
    BUILD SUCCESSFUL
    Total time: 6 seconds
    I am sure its something minor, but would appreciate any help.
    Thanks,
    John

    Hi
    This should be fixed in the 8.1 release can you try it with GA version.
    Thanks
    Ajay
    "John McGraw" <[email protected]> wrote in message
    news:[email protected]...
    >
    I downloaded the webservice encrypt example and installed per thedirections.
    However, when attempting to run the client. I am getting this error...
    Buildfile: build.xml
    run:
    [java] <Jul 2, 2003 8:59:57 AM EDT> <Info> <webservice> <BEA-220024><Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception fromits
    handleRequest method. The exception was:
    [java] weblogic.xml.security.SecurityConfigurationException: Failedadding
    encryption to request - with nested exception:
    [java] [weblogic.xml.security.SecurityProcessingException: Problem
    adding> encrypted key - with nested exception:>      [java java.rmi.RemoteException: SOAPFault:javax.xml.rpc.soap.SOAPFaultException:
    Failed adding encryption to request; nested exception is:
    [java] javax.xml.rpc.soap.SOAPFaultException: Failed addingencryption to
    request
    [java] [weblogic.xml.security.encryption.EncryptionException:http://www.w3.org/2001/04/xmlenc#tripledes-cbc
    can only be used with a domestic license]].>
    [java] at sign.SecurityPort_Stub.echo(SecurityPort_Stub.java:30)
    [java] at sign.SecureClient.main(SecureClient.java:63)
    [java] Caused by: javax.xml.rpc.soap.SOAPFaultException: Failedadding encryption
    to request
    [java] atweblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:270)
    [java] atweblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:131
    [java] atweblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:430)
    [java] atweblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:416)
    [java] atweblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:275)
    [java] atweblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:250)
    [java] at sign.SecurityPort_Stub.echo(SecurityPort_Stub.java:27)
    [java] ... 1 more
    [java] Exception in thread "main"
    BUILD SUCCESSFUL
    Total time: 6 seconds
    I am sure its something minor, but would appreciate any help.
    Thanks,
    John

  • Question: Best Way to Encrypt a Single Document . . .

    I'd like to encrypt at the document level. Just need to do so for several items.
    What's the simplest good way to do this? What program?
    Thanks in advance!
    Ed in Dallas

    It looks as if Espionage IS a GUI wrapper around a standard OS X encrypted disk image - see this Espionage support page:
    *How does Espionage work?*
    http://www.taoeffect.com/espionage/EspionageHelp/pages/faq-workings.html
    Espionage apparently adds an elaborate additional GUI layer to make it seem as if you are dealing with a "protected folder" rather than a disk image - the above support page states "FileVault works in the same way."
    It seems to me that this convenience just adds an additional component that could go wrong - if either the underlying encrypted disk image OR the GUI interface to it goes wrong, you could lose all the contents.
    You can apparently also have "unencrypted password protected folders"
    http://www.taoeffect.com/espionage/EspionageHelp/pages/faq-unencrypted.html
    The above documentation doesn't mention whether these "unencrypted password-protected folders" also employ underlying disk images, but regardless, they are apparently not secure. The above support page includes:
    However, it's fairly simple to get past this password prompt.
    If the folder was not encrypted, however, you would be able to see its contents after disabling Espionage's helper program.
    If you want your data to be secure, use encryption.
    And adding encryption again brings you back to Espionage's use of an underlying encrypted disk image along with its GUI wrapper.

  • Mig7 project Debugging with ILA core - Timing Error in implementation

    Hello,
    I am designing a core which has only performing read/write operations to/from DDR3 SDRAM with MIG7 IP core. I am synthesizing and implementing without any problem if I have no ILA core present in the project. After adding the ILA core I am having errors at implementation (Route Design). I used Set up Debug wizard while creating cores and .xdc file.
    After several trials I have seen 2 types of errors:
    [Drc 23-20] Rule violation (PDRC-29) MMCM_adv_ClkFrequency_clkin1 - The calculated frequency value, 0.000 MHz, of the CLKIN1_PERIOD attribute on the MMCME2_ADV site MMCME2_ADV_X1Y1 (cell tranceiver/u_mig_7series_0_mig/u_ddr3_infrastructure/gen_mmcm.mmcm_i) is outside the allowed range (10.000 - 933.000 MHz). Please change the CLKIN1_PERIOD attribute value in order to be within the allowed range for this device.
    [Drc 23-20] Rule violation (PDRC-34) MMCM_adv_ClkFrequency_div_no_dclk - The computed value 500.000 MHz (CLKIN1_PERIOD, net CLK) for the VCO operating frequency of the MMCME2_ADV site MMCME2_ADV_X1Y0 (cell dbg_hub/inst/USE_DIVIDER.U_GT_MMCM) falls outside the operating range of the MMCM VCO frequency for this device (600 - 1440 MHz). The computed value is (CLKFBOUT_MULT_F * 1000 / (CLKINx_PERIOD * DIVCLK_DIVIDE)). Please adjust either the input period CLKINx_PERIOD (10.000000), multiplication factor CLKFBOUT_MULT_F (5.000000) or the division factor DIVCLK_DIVIDE (1), in order to achieve a VCO frequency within the rated operating range for this device.
    [Vivado_Tcl 4-16] Error(s) found during DRC. Router not run.
    In xdc file I have changed two parameters:
    set_property C_CLK_INPUT_FREQ_HZ 200000000 [get_debug_cores dbg_hub] -- it was 300000000 before as default
    set_property C_ENABLE_CLK_DIVIDER true [get_debug_cores dbg_hub] -- it was false
    I added xdc file and error description in the attachments.
    I could not find any solution.
    Best regards, Ali

    I guess I have solved the problem, if it is a problem.
    In the description of the property, C_CLK_INPUT_FREQ_HZ,  it says that "this property is only used when C_ENABLE_CLK_DIVIDER property is set true". However when I set true it gives clock frequency error as I have given in the error description.
    Then I have set C_ENABLE_CLK_DIVIDER property to false and then tried with that. And everything gone well. The project is working as I intented.
    I guess there is a mistake in the explanation or I just misunderstood the sentence.
    Thanks for the previous replays.

  • Using Encrypt Policy in OSB

    HI,
    I am struggling to enforce inbound message level security at the proxy service level.
    I just wanted to encrypt the request and response payload of the proxy service .
    I have tried all my best and added encrypt policy to request and response at the policy tab of proxy service.
    Please guide me how to enforce it .
    Abhinav

    Anuj ,
    i am using self signed certificate for service key provider.
    My request :
    <soapenv:Envelope xmlns:prox="http://in.abhinav/ProxyPayload_Master" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-6" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>weblogic</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">weblogic123</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">za2EsbtNUse5t2Y9DjL9jA==</wsse:Nonce>
    <wsu:Created>2012-01-16T06:57:06.769Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    <prox:SendOperationRequest>
    <username>?</username>
    <password>?</password>
    <mobilePhoneNumber>?</mobilePhoneNumber>
    <vouchernumber>?</vouchernumber>
    </prox:SendOperationRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    Resposne :
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <faultcode>wsse:InvalidSecurity</faultcode>
    <faultstring>Could not validate encryption against any of the supported token types</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>

  • [SOLVED] Root partition wrongly assumed to be encrypted.

    Hi,
    I'm trying to install arch using newest iso image (2012.10.06) in a following manner:
    gpt partition on /dev/sda1
    root on btrfs on /dev/sda2
    var on btrfs on /dev/sda3
    home on btrfs on /dev/mapper/crypt (LUKS) on /dev/sda4,
    but I have a problem after booting into freshly installed system. There's a message stating that:
    ERROR: Failed to open encryption mapping: The device /dev/sda2 is not a LUKS volume and the crypto= parameter was not specified.
    (actually there's uuid instead of /dev/sda2 but I've changed it for brevity)
    Then after some time I get an error:
    [ TIME ] Timed out waiting for device dev-mapper-crypt.device
    then some "dependency failed" messages and I get welcomed to the emergency mode prompt.
    I've added encrypt before filesystems to mkinitcpio hooks, and rebuild the image.
    My /etc/fstab is generated by genfstab at installation and looks like this (comments ommited):
    /dev/sda2 / btrfs rw,noatime,compress=lzo,space_cache,subvol=/__active 0 0
    /dev/mapper/crypt /home btrfs rw,noatime,compress=lzo,space_cache,subvol=/__active 0 0
    /dev/sda3 /var btrfs rw,noatime,compress=lzo,space_cache,subvol=/__active 0 0
    Problem is that my / is NOT encrypted, only my home partition. But when I remove my home partition entry from fstab system boots to normal login prompt (but the error saying / is not a LUKS partition still shows up).
    What am I doing wrong? I didn't alter my grub.cfg after running grub-mkconfig, and there are no entries in it stating that root is encrypted (only flags are: subvol=__active). How can I prompt the user (me) for passphrase on boot? As far as I read it should be done automatically by "encrypt" hook.
    Any suggestions?
    cheers,
    kajman
    Last edited by kajman (2012-10-18 08:45:05)

    What are the boot parameters in grub?
    You need a cryptdevice= entry if you want to unlock it from the initramfs.
    For the syntax read the help of the encrypt hook:
    mkinitcpio -H encrypt
    If it's only for the home partition, I would unlock it from /etc/crypttab instead of the initramfs.

  • Trying to encrypt and decrypt localy

    here is what i am doing
    import javax.swing.JOptionPane;
    import java.io.*;
    import javax.crypto.Cipher;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.KeyGenerator;
    import java.security.Key;
    import java.security.InvalidKeyException;
    public class LocalEncrypter
         private static String algorithm = "DESede";
    private static Key key = null;
    private static Cipher cipher = null;
    private static void setUp() throws Exception
    //this next line gets an instance of the algm to encypt and generates the key for it
         key = KeyGenerator.getInstance(algorithm).generateKey();
         //this next line creates a cipher obj for the algm.
    cipher = Cipher.getInstance(algorithm);
    public static void main(String[] args) throws Exception
         setUp();//generates key and create cipher
    FileOutputStream fos = new FileOutputStream("test.obj");
         ObjectOutputStream oos = new ObjectOutputStream(fos);
    byte[] encryptionBytes = null;
    String input = JOptionPane.showInputDialog( "enter message to encrypt");
    encryptionBytes = encrypt(input);//encyrption being performed
    oos.writeObject(encryptionBytes);
    oos.flush();
    oos.close();
    System.exit(0);
    //this method encrypts the string inputed
    private static byte[] encrypt(String input) throws InvalidKeyException,
    BadPaddingException,IllegalBlockSizeException
    cipher.init(Cipher.ENCRYPT_MODE, key);//initialized the cipher to encyption mode
    //key is used to know how to encypt
    byte[] inputBytes = input.getBytes();//gets the byte array from the sting inputed
    inputBytes = cipher.doFinal(inputBytes);//create the ciphered byte array
    return inputBytes;//returns the byte array
    //////////////////other class
    import javax.swing.JOptionPane;
    import java.io.*;
    import javax.crypto.Cipher;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.KeyGenerator;
    import java.security.Key;
    import java.security.InvalidKeyException;
    public class LocalDecrypter
         private static String algorithm = "DESede";
    private static Key key = null;
    private static Cipher cipher = null;
    private static void setUp() throws Exception
    //this next line gets an instance of the algm to encypt and generates the key for it
         key = KeyGenerator.getInstance(algorithm).generateKey();
         //this next line creates a cipher obj for the algm.
    cipher = Cipher.getInstance(algorithm);
    public static void main(String[] args) throws Exception
         setUp();//generates key and create cipher
    FileInputStream fis = new FileInputStream("test.obj");
         ObjectInputStream ois = new ObjectInputStream(fis);
    byte[] dencryptionBytes = null;
    dencryptionBytes = (byte [])ois.readObject();
    ois.close();
    for(int i=0 ; i < dencryptionBytes.length;i++)
    System.out.print(dencryptionBytes);
    System.out.println();
    String s = decrypt(dencryptionBytes);
    System.out.println(s);
    System.exit(0);
         //this method decyprts the string inputed.
    private static String decrypt(byte[] encryptionBytes) throws InvalidKeyException,
    BadPaddingException,IllegalBlockSizeException
    cipher.init(Cipher.DECRYPT_MODE, key);//initialze the cipher to decyption
    //key is used to know how to decrypt.
    byte[] recoveredBytes = cipher.doFinal(encryptionBytes);//recover the cipher text
    String recovered = new String(recoveredBytes);//create a string from the byte []
    return recovered;//return the new deciphered string.
    I encrypt fine but here is my error now i know for sure that this would work if i was using sockets cause the streams would be piped and set ok cause of tcp protocol.
    but saving it in a file or writing the object this exception occurs.
    any help guys
    C:\Documents and Settings\jimmy\Desktop\cipher>java LocalDecrypter
    -6052-5-39-33-412693
    Exception in thread "main" javax.crypto.BadPaddingException: Given final block n
    ot properly padded
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.DESedeCipher.engineDoFinal(DashoA6275)
    at javax.crypto.Cipher.doFinal(DashoA6275)
    at LocalDecrypter.decrypt(LocalDecrypter.java:56)
    at LocalDecrypter.main(LocalDecrypter.java:42)

    (your original classes with Base64 and key sharing funtionality added:)
    // ***************************************** ENCRYPT ********************************************** //
    import javax.swing.JOptionPane;
    import java.io.*;
    import javax.crypto.Cipher;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import java.security.InvalidKeyException;
    import sun.misc.BASE64Encoder;
    import sun.misc.BASE64Decoder;
    public class LocalEncrypter {
         private static String algorithm = "DESede";
         private static SecretKey key = null;
         private static Cipher cipher = null;
         private static void setUp() throws Exception {
              //this next line gets an instance of the algm to encypt and generates the key for it
              key = KeyGenerator.getInstance(algorithm).generateKey();
              //this next line creates a cipher obj for the algm.
              cipher = Cipher.getInstance(algorithm);
         private static void saveKey(String filename) throws Exception {
              byte[] byteSeed = key.getEncoded();
              BASE64Encoder encoder = new BASE64Encoder();
              String seed = encoder.encodeBuffer(byteSeed);
              FileWriter fw = new FileWriter(filename);
              fw.write(seed);
              fw.close();          
         public static void main(String[] args) throws Exception {
              setUp();//generates key and create cipher
              FileOutputStream fos = new FileOutputStream("test.obj");
              ObjectOutputStream oos = new ObjectOutputStream(fos);     
              byte[] encryptionBytes = null;
              String input = JOptionPane.showInputDialog( "enter message to encrypt");
              encryptionBytes = encrypt(input);//encyrption being performed
              oos.writeObject(encryptionBytes);
              oos.flush();
              oos.close();
              saveKey("key.txt");
              System.exit(0);
         //this method encrypts the string inputed
         private static byte[] encrypt(String input) throws Exception {
              cipher.init(Cipher.ENCRYPT_MODE, key);//initialized the cipher to encyption mode
              //key is used to know how to encypt
              byte[] inputBytes = input.getBytes();//gets the byte array from the sting inputed
              inputBytes = cipher.doFinal(inputBytes);//create the ciphered byte array
              BASE64Encoder encoder = new BASE64Encoder();
              String ciphertextB64 = encoder.encodeBuffer(inputBytes);
              return ciphertextB64.getBytes();//returns the byte array
    // ***************************************** DECRYPT ********************************************** //
    import javax.swing.JOptionPane;
    import java.io.*;
    import javax.crypto.Cipher;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.spec.SecretKeySpec;
    import java.security.InvalidKeyException;
    import sun.misc.BASE64Decoder;
    public class LocalDecrypter {
         private static String algorithm = "DESede";
         private static SecretKey key = null;
         private static Cipher cipher = null;
         private static SecretKey loadKey(String filename) throws Exception {
              FileInputStream fis = new FileInputStream(filename);
              byte[] encKey = new byte[fis.available()];
              fis.read(encKey);
              fis.close();
              String seed = new String(encKey);
              BASE64Decoder decoder = new BASE64Decoder();
              byte[] byteSeed = decoder.decodeBuffer(seed);
              SecretKey myKey = new SecretKeySpec(byteSeed, algorithm);
              return myKey;
         private static void setUp() throws Exception {
              //this next line creates a cipher obj for the algm.
              cipher = Cipher.getInstance(algorithm);
         public static void main(String[] args) throws Exception {
              setUp();//generates key and create cipher
              key = loadKey("key.txt");
              FileInputStream fis = new FileInputStream("test.obj");
              ObjectInputStream ois = new ObjectInputStream(fis);
              byte[] dencryptionBytes = null;
              dencryptionBytes = (byte [])ois.readObject();
              ois.close();
              for(int i=0 ; i < dencryptionBytes.length;i++)
                   System.out.print(dencryptionBytes);
                   System.out.println();
                   String s = decrypt(dencryptionBytes);
                   System.out.println(s);
                   System.exit(0);
              //this method decyprts the string inputed.
              private static String decrypt(byte[] encryptionBytesB64) throws Exception {
              BASE64Decoder decoder = new BASE64Decoder();
              byte[] encryptionBytes = decoder.decodeBuffer(new String(encryptionBytesB64));
              cipher.init(Cipher.DECRYPT_MODE, key);//initialze the cipher to decyption
              //key is used to know how to decrypt.
              byte[] recoveredBytes = cipher.doFinal(encryptionBytes);//recover the cipher text
              String recovered = new String(recoveredBytes);//create a string from the byte []
              return recovered;//return the new deciphered string.

  • Is the 2.16Ghz the equivilent to 4.32Ghz Because of Core 2 Duo?

    I read a post a few pages in on the main forum, and someone was talking about the 17inch MBP having 4.66Ghz of power... Is this the correct way of calculating it? If it is, then I feel like I've bagged a bargain (the price of my 15inch MBP Being {£1349})
    I know that my pc's AMD Athlon's processor is actually 3Ghz (marked as 2Ghz but actually 3 compaired to Intel's older chips)

    That's like asking "If two cars are each going 60 MPH does that mean that together they are going 120MPH?" The reason we are seeing multi core procs and multi proc computers is that once CPUs started pushing 3-4 GHZ the heat became impossible to control. The newer procs are using a more efficient architecture that allows them to accomplish more per cycle. Therefore, the procs can run at much lower clock speeds which translates into much cooler chips. Adding additional CPU cores allows the workload to be distributed over several CPUs, adding to the efficiency (speed) of the computer.

  • Core data refuses to work

    hi.
    I have a very simple model, it contains 1 entity with 4 attributes.
    I have created an ObjectController in IB, and bound it to my persistent document's object context.
    I follow this code (found in the core data documentation)to get a reference to the Object, and to set/get values:
    NSManagedObject *myDoc = [NSEntityDescription insertNewObjectForEntityForName:@"BKSketchDocMO" inManagedObjectContext:[dataSource managedObjectContext]];
    thePanX = [[myDoc valueForKey:@"docPanX"] floatValue];
    [myDoc setValue:[NSNumber numberWithFloat:[self bounds].size.width/2] forKey:@"docPanX"];
    now we come to the problem.
    its doesn't work. theres an entity. I can get a reference to it, and it ALWAYS has the default values. NOTHING i do changes the values, NOTHING i do gives me anything Except the default values.
    and since core data is basically a black box... I CAN"T DEBUG IT.
    can anyone, shed any light on anything that might explain why I can get the object, get values, but I cannot set values?
    signed,
    getting frustrated by the core data double-talk and general lack of any real, and useful documentation.
    Message was edited by: Edward Devlin1

    Hi kids, yet again I have answered my own question. in my application, I could not make my object graph self populate, and then when i did get it to populate programatically, I could not access the data.
    I have solved both problems. one was a conceptual problem, and the other was operator error building off of a conceptual problem.
    first, lets tackle why my object graph doesn't auto populate. in IB i made an Object controller, and I hooked it up to my entity. I told the controller to automatically prepare content. I had assumed that it meant that when my Object Context was instantiated, it would automatically create an instance of my referenced object. this is Not how core data works. Currently i am working under the impression that "automatically prepares content" mean that when an entity is instantiated, it will fill out the appropriate values, with the defaults you set up in your object model.
    so core data Does not actually instantiate anything for you. once I made this conceptual leap, I was still hazy on the implementation. I tried adding new entities upon initialization, but that tended to over-write entities opened from a saved document. in the end, I simply settled on making sure the entity existed when i tried to access its information. If it didn't exist I made one before trying to access it. in practice, this is a very slick and robust solution.
    now for problem #2... every time I tried to access my data, it is like it was zeroed out to the default settings.
    well, thats exactly what was happening. my entity was valid, I was making changes to it, and I was still getting the default values back. How was this happening? I didn't understand what i was doing.
    heres what I thought was happening. I thought I was making a new ManagedObject, and filling it with the values of the entity I was trying to access, then I got the values from that ManagedObject, and discarded it.
    What was really happening: If you look at my code, you'll see a method called : "insertNewObjectForEntityForName:" this is the method I THOUGHT was going to my ObjectContext, getting my entity and creating a ManagedObject from it for me to interface with. Clever coders will see the problem right away. Insert new Object? I was creating a new instance of my entity each time i Thought I was accessing the original. holy crap! of course I was only getting the default values... and sure I was able to make a change to the values, but the next time I tried to access them, I would just get a new entity, filled with default values!
    so InsertNewObject, was the wrong approach... what turned out to be the correct approach? heres why i was having such a bad time of this... NSDictionary, is roughly analogous to Core Data. I have alot of experience w/ NSDictionary, and so i expected a straight forward... give me an object based on this key method. I understood that i was going to have to work through a proxy, but I had assumed a little too much about how Core data works. its not like NSDictionary at all. it works much more like a search engine... you tell it where, and what to look for and it will bring you back a list of things that are kinda like what you're looking for.
    This is called a fetch request. Its a much more elaborate way to look for stuff than a simple objectForKey: method. its how you get your information from core data. Information comes back as an array of NSManagedObjects. The documentation made everything so much more difficult because it spoke of fetched values as something extra or added on to core data. Kids say it along w/ me.... fetch requests are how you get info from core data. repeat.

  • Core Image Fun House stopped working

    I installed the developer tools so I could change the parameters of the harddrive spindown.
    An added bonus was core image fun house, which is indeed fun.
    Or more accurately was fun because now its stopped working. It loads fine but nothing works within the application, I have not experienced crashes or anything so its most odd.
    I repaired permissions, optimised the system, re-installed the developer tool kit, removed the folder from Application support and deleted the plist file. Then after all that I restarted the mac and still nothing.
    When you try to apply effects you get this in the console, regarding any effect you are trying to do:
    2006-03-25 14:25:01.092 Core Image Fun House[600] CIPerspectiveTransform: perspective: nil value for argument #0 (source)
    2006-03-25 14:25:23.193 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:24.471 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:25.075 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:30.412 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:30.630 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:32.862 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:32.929 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:33.030 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:33.080 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:34.423 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    2006-03-25 14:25:34.624 Core Image Fun House[609] CIPerspectiveTile: perspectiveTile: nil value for argument #0 (src)
    Any ideas?

    I made the tests on a Core Image enabled eMac G4 (at least this is what is reported by System Profiler.app).
    I had a confirm that the software is broken from a friend of mine and I found this archived thread that reported the same error in console.log.
    Any idea of what's going on?

  • Encrypt netbook completely

    Ahoy there!
    I'd like to encrypt my netbook completely - as the topic allready meantioned it...
    The following is what i want:
    Formatting my Disk(sda) and build a big encrypted container on it.
    Within this container there shell be Logical Volumes for:
    /root
    /swap
    /home
    The boot-partition shell be installed seperatelyon my usb(sdb).
    Correct me if i'm false, but i think that's called LVM on Luks - with a seperate boot-partition.
    i found this instruction:
    https://wiki.archlinux.org/index.php/Dm … VM_on_LUKS
    I tried that in a VM.
    The installation went fine, no failures.
    After i installed everything i rebooted.
    The machine started up an.....
    booting...
    ...nothing more...
    Where's my failure?
    I think the mistake i made(obviously) must be somewhere on my usb.
    So here's all i did with it:
    With gdisk i created a 500MB-partition with typ 8300.
    mkfs.ext2 /dev/sdb1
    mkdir /mnt/boot
    mount /dev/sdb1 /mnt/boot
    parted /dev/sdb set 1 bios_grub on
    after that i installed grub
    grub-mkconfig -o /boot/grub/grub.cfg
    and last but not least
    grub-install /dev/sdb

    R3D wrote:if you have a bios motherboard you need to create a bios boot partition. not a linux partition.
    Ops...I tried it again with making a bios partition...same problem -.-"
    R3D wrote:Are these the only commands you ran?
    No, here's my COMPLETE installation process:
    Creating a bios partition on sdb, 500MB, typ ef02
    creating an encrypted container on sda, max size, typ 8E00
    cryptsetup luksFormat /dev/sda1
    cryptsetup open --type luks /dev/sda1 lvm
    pvcreate /dev/mapper/lvm
    vgcreate Main /dev/mapper/lvm
    lvcreate -L 8G Main -n rootvol
    lvcreate -L 3G Main -n homevol
    lvcreate -L 1G Main -n swapvol
    mkfs.ext4 /dev/mapper/Main-rootvol
    mkfs.ext4 /dev/mapper/Main-homevol
    mkswap /dev/mapper/Main-swapvol
    mount /dev/Main/rootvol /mnt
    mkdir /mnt/home
    mount /dev/Main/homevol /mnt/home
    mkdir /mnt/boot
    mount /dev/sdb1 /mnt/boot
    swapon /dev/mapper/Main-swapvol
    Then i edited /etc/pacman.d/mirrorlist for my needs.
    I installed the basic-system with pacstrap /mnt base base-devel
    created the fstab:
    genfstab -p /mnt > /mnt/etc/fstab
    Then:
    arch-chroot /mnt/
    set the computername, Language settings, keyboardsettings, localtime, edited locale.gen (all that standard procedure)
    after that i edited /etc/mkinitcpio.conf
    and added encrypt and lvm2 in the HOOKS line
    mkinitcpio -p linux
    setting the root password, installing grub
    cryptdevice=/dev/sda:Main root=/dev/mapper/Main-rootvol
    grub-mkconfig -o /boot/grub/grub.cfg
    after that the installation of grub onto the usb
    grub-install /dev/sdb
    Here's the point where i exit chroot and umount the drives.
    i rebooted and here we are back again at the good old
    booting...
    and nothing more
    [EDIT]
    Meanwhile i also tried something different.
    I didn't typed
    cryptdevice=/dev/sda:Main root=/dev/mapper/Main-rootvol
    but i changed the line GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub to:
    GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda1:main"
    Nothing helps. I feel like i tried 100 things now(at least).
    ...I'm going to become insane...
    Last edited by qwwyzq (2014-06-11 15:51:12)

  • Install on mdadm-raid1 / cryptsetup home - GRUB-Problems

    I try to install arch-linux on some lvl1-raids done with mdadm and a home-partition encrypted with cryptsetup.
    I dont want an lvm, just some lvl1 raids.
    I've added encrypt and mdadm_udev to the kernel-image.
    I've got two harddisks in my laptop, one is filled with fedora-stuff which I want to copy to the new system. So I created the raids with /dev/sdbX and missing.
    /dev/md0 - /dev/sdb1 & missing is swap
    /dev/md1 - /dev/sdb2 & missing is root (ext4)
    /dev/md2 - /dev/sdb3 & missing is /boot (ext4)
    /dev/md3 - /dev/sdb4 & missing is /dev/mapper/home (luks) is /home (ext4)
    I tried to install grub as boot-manager, grub-mkconfig fail:
    sh-4.2# grub-mkconfig -o /boot/grub/grub.cfg
    Generating grub configuration file ...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    Found linux image: /boot/vmlinuz-linux
    Found initrd image: /boot/initramfs-linux.img
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    /usr/bin/grub-probe: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    error: out of memory
    error: syntax error.
    error: Incorrect command.
    error: syntax error.
    Syntax error at line 168
    Syntax error detected in generated GRUB config file.
    Ensure that there are no errors in /etc/default/grub
    and /etc/grub.d/* files or please file a bug report with
    /boot/grub/grub.cfg.new file attached.done
    I didn't touched /etc/default/grub nor any file of /etc/grub.d/*. Just added my home-partition to /etc/crypttab and my raids to /etc/mdadm.conf ... else I let genfstab generate my /etc/fstab.
    My /boot/grub/grub.cfg.new:
    http://pastebin.com/PXGY6GrN
    Hope you might help me
    Best Regards
    Ruben

    Thanks for your hint, the line with "out of memory" and following are gone now.
    The "grub-install --target=i386-pc --recheck /dev/sdb" outputs the following:
    grub-install: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    grub-install: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image...
    grub-install: error: cannot open '/usr/lib/grub/i386-pc/msdos.mod': No such file or directory.

Maybe you are looking for

  • Can't open PSD file

    I'm new to Photoshop CC and just installed a couple days ago.  I saved a file with a PSD extension and when I try to open it I get an error message that the file amtlib.dll did not install.  Anyone know about this and what to do?

  • I am getting an error message that reads "Cannot ____ because the scratch disks are full. How do I go about clearing this? I have a Macbook. Thanks.

    I have only had Photoshop elements on my computer for less than a month (free trial). The past few days I am getting an error message whenever I try to do anything that reads "Cannot __ because the scratch disks are full." I do not know how to fix th

  • Software recover tool unable to connect to server

    Hi There I am trying to use the software recovery tool for my Lumia 1020 but keep getting unable to connect to server message. Im am running Windows 8.1. Has anyone had this problem or have a fix for this. Many Thanks for any advice.Tony Solved! Go t

  • Tablet, note taking + drawing

    Hey, I'm a chem student and I saw someone on a PC connect a Waicom tablet and use some program (evernote??) and they were pretty much using their computer as a note pad and making physical notes digital.. this would be really helpful especially with

  • Oracle/Java Time Discrepancy

    I have an Oracle procedure that rebuilds the index and a java application that calls the procedure. I don't pass any timestamp at all, I just tell it to start and how long (approx) to run and then post the results in the GUI. When I run the procedure