Encrypting data on card

Hello, I was hoping somebody would be able to explain some queries I have regarding encryption. I have been attempting to encrypt data in my card but I have been unable to find enough documentation to cover the topic thoroughly. What I have done is;
Declare my variables:
protected byte[] KeyData;
protected Key des_key;
protected Cipher cipher;
I have then initialised them in my constructor prior to a call to the register method, as follows:
// Create DES key
DESKey des_key = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
// Initialise DES key
KeyData = new byte[]{(byte)1};
des_key.setKey(KeyData, (short)0);
// Create Cipher object with the DES algorithm
cipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD, false);
// Initialise with DES key for encryption
cipher.init(des_key, Cipher.MODE_ENCRYPT);
register();
In one of my methods, I then attempt to encrypt data contained in the byte array 'temp':
// Encrypt data and write into jcname array
cipher.doFinal(temp, Offset, len, jcname, Offset);
When I have tested this in jcwde the create method fails with the sw()6444.
I'm afraid I don't understand how the Key is created or what should be contained within the KeyData array, this may be where my problem is arising. If you can help or provide some explanation of what is happening I would be very grateful. TIA
Tony

The error code you are getting is because the crypto isn't implemented. The crypto is hardcoded to return that. If you peek at the code, you'll see that none of the cyrpto packages are implemented.
So you have to write them yourself or find an implementation somewhere.
When you buy a kit from a vendor, the cards will contain some form of crypto ( DES, 3DES, RSA) and you can fully test it out that way.

Similar Messages

  • Encrypt data send from a non-SAP system to ECC.

    Hi,
    We are tryign to encrypt the credit card details send from web (non-sap system) via a xml file to ECC.
    From Basis side, I have exported the public key from the ECC for the web server to encrypt the CC details while sending via xml.
    The external web consultants encrypted the cc detail with the public key and send it via xml but that was not able to decrypt at the ECC side.
    The developers were using the FM 'CCARD_DEVELOPE'at ECC to decrypt the data in the xml file. It was saying SSF error: No data transfered.
    Meanwhile SAP CryptoLib is installed and credit card encryption/decryption is working fine for CC details entered via GUI interface.
    Is there anything I am missing out here to encrypt CC details send from a Non-SAP system to ECC.? Do we need to load the SAP cryptolib in the non-SAP system to ecrypt this data at the senders end. Or is there a alternate solution for this ?
    We are in ECC6.0/RHEL/Oracle10204.
    Appreciate your help.
    Thanks

    Hi Nelis,
    Thanks for your reply.
    This note does not get any information regarding encrypting data from a non-SAP system to SAp system.
    I am looking setup/information for encrypting data from a non-SAP system to SAP system.
    Thanks

  • Its wrong to Encrypt your SDHC card

    Hi Everyone;
    I encrypted my the fixed memory on my nokia e75 and it seemingly worked fine.  With the maximum 20 minute setting the phone "autolocks" up; ok I'll try to live with that.
    Then I encrypt my 8 GB mini HDSC card and find that it says "Please delete some data, memory card full" "0 B available".  I see gibberish symbols when I go to look on the drive contents.  Note also I can't get into any folder; then I turn of the encryption, and the memory card still remains the same, what my PC refers to it - "Corrupted".
    I don't get how anyone can make something for civilians that comes with a self-destruct feature. 
    Remember hitting the Kudos (green star) button increases the chance of others finding workable advice quicker.

    I should have said that going onto the "File Manager" program all writing remained encoded/jumbled and the phone did not give any function available to format the card or perform any other function... Not even to access a folder. That's the phone itself; my pc declared the card corrupt.
    In order to format it I had to get an HSDC card adapter for my PC then format it.
    Remember hitting the Kudos (green star) button increases the chance of others finding workable advice quicker.

  • How to make encrypted data more secure?

    Hi All,
    We are using Oracle 9i database. We have a task to encrypt some of data before storing into database. We have developed a function to encrypt the data using Dbms_Obfuscation toolkit. But, the user who has access to that function source code can easily decrypt the data. Now we need to have the solution so that we can securely save/store Encryption Key, which can be accessed by Application User only.
    One alternative we are thinking is creating a table in SYS user and storing the value there. We can grant SELECT privileges to Application User Only.
    We are looking for other alternatives if we have any. Do you have any idea?
    Thanks in Advance.
    Thanks and Best Regards,
    Dharmesh Patel
    Database Server:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    ******************************************************/

    I had a look at this conundrum a while back, when we wanted to store credit card details in a database. Basically, there are two choices:
    (1) Don't store the key in the database and make the users type it in whenever they want to see encrypted data; or
    (2) Store the key in the database and accept the risk that it might be abused by privileged users (i.e. DBAs).
    As many users have difficulty remembering their password when it's MOM123 I think it's unlikely they will be able to cope with a properly secure PKI string.
    You can mitigate the risks inherent in option 2 by having very strong auditing of the function's execution, but I'm sure knowledgeable, black-hatted DBAs will be able to find workarounds.
    But, if you can't trust your DBAs you're probably stuffed anyway.
    Cheers, APC

  • EFS, password change denies access to encrypted data

    Hi,
    Has anyone had the issue with admin changing users password in Console One
    resulting in users not being able to access their encrypted data.
    Laptop users are using EFS to encrypt their data.
    These users have WinXPPro SP2 and we are running ZfD 6.5SP2.
    I have found IR 1 for ZfD 6.5 SP2 which includes TID3003874 "Personal IE
    certificates and EFS stop working after password change" however this does
    not fix the issue.
    Could someone explain in more detail what this fix does as I may have
    misunderstood what this fix is.
    Regards,
    Eric.

    I know this is an old thread, but I thought it would be best to those who
    found it realized that the best method for addressing this issue may be
    found here:
    http://www.novell.com/support/viewCo...rnalId=3724689
    However the MS article could still be useful for some.
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Support Forums Volunteer Sysop
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.
    "ghoskins" <[email protected]> wrote in message
    news:[email protected]..
    >
    > I'm having the same problem. I ran acrosss this Microsoft KB and it
    > seems to fix the issue. I'm not certain this is the best security
    > practices, but it does work.
    >
    > 'User cannot gain access to certificate functionality after password
    > change or when using a roaming profile'
    > (http://support.microsoft.com/default...b;en-us;331333)
    >
    >
    > --
    > ghoskins
    > ------------------------------------------------------------------------
    > ghoskins's Profile: http://forums.novell.com/member.php?userid=12306
    > View this thread: http://forums.novell.com/showthread.php?t=215857
    >

  • What happens to encrypted data when the server is destroyed?

    Backups to tape are encrypted with a certificate. 
    But what happens if the backup server is destroyed? Do I lose all the backup data on those tapes?
    Can I backup the certificate or is it specific to that specific DPM server?
    In the case of a catastrophic datacenter failure, where everything is lost except the tapes and the certificate, what is the process for recovering the encrypted data?

    You can absolutely backup the certificates used for DPM encryption and you should store those somewhere safe (for example, burn to CD and put in a fireproof safe offsite somewhere secure in an encrypted file).
    This section of TechNet describes the process: http://technet.microsoft.com/en-us/library/jj628058.aspx
    If you had to recreate a DPM server to read the tapes then you'd need to the certificates in the correct certificate store on the DPM server, in addition you'd need to ensure you had the certificates for the certificate chain, if there is one, in the correct
    locations in the cert store.
    Once a cert expires, do not delete it from the DPM until all the tapes that have used that cert are no longer in use or have been overwritten.
    The data would need to be imported through the recovery section in DPM but you'd be able to read and recover the data if the certs were present. No cert = no recovery.

  • Encrypting Data on part of a file system.

    A few months ago, using hints I found on the internet, I was able to use diskutil command line utililty to create an encrypted partition of the same sort as when turning FileVault on in Security Preferences.  File Vault doe not appear to offer a way to choose some pargt of the disk storage such as an entire drive of a folder on a drive.  I was able to do it and it worked.  When I mount the disk partition to the system (usualy by plugging it in and turning it on), I'm asked for the security pass phrase or key to decrypt it.  Once mounted with the key supplied, I can access it as any other mounted disk with the type of access restrictions that might be present on any disk.Since I want the data to be truly privatem U decline to put the key into the a known place such as the keychain.  I don't want just anyone who has a log on to this iMac to b e able to read this data.  I want them to need to enter a private key to mount the data. 
    My only problem with this is the hoops I needed to go through to do this.  It is complicated and invovlves setting up special partitions for the purpose.
    Searching Finder help for encrypting data it offered a solution for data on a removable drive.  The stepsare very simple and easy to do:
       a) Mount the files to be encrypted if they are not  online.  They also need to be in a folder or even an entire partition.
        b) Open Disk Utility (GUI version)
        c)Choose File > New > Disk Image From Folder (or New-> Disk Image ffrom a Device).
        d) Select the folder or disk you want to encrypt.
        e) A save dialog will pop up.  Select the name of the archive you wish to create and select a location.  I choose a removable disk partition which has enouh space.  Select Compressed if you wish.  Then Select Encryption and choose the key size for encryption from the drop dwon.  When you click Save, Disk Utility begins creating a disk image that is (possibly) compressed and probably encrypted.  Once done, the files in the folder or partiion are hiddent behind the encryption.  To get to them, you much open the DMG file and supply the password to unlock the encryption.  You can save the key in the keychain if you are not worreid about who can get in.  If you wish to restrict access to fewer people, keep the key secret and provide a recovery mechanism that is suitable for you need.
       f)  One the archive is created, the disk partition containing it may b4 mounted on the system (if it is not there already) and by opening the dmg file you will be asked for the key.  The system will validate that the key works and the encryption and comprewssion are working.  The archive will be mounted as a virual disk.  It can be accessed by any useer of that computer unless the file permissions get in the way.  Mounting it only when the computer is being used by authorized people allow you to mount and dismount the archive for use during a limited time.
    I have a couple of questions here.  Is there an easier way to do this?  Is this encryption as strong as that used in FileVault? 

    No. I don't know why it would not be, except it is easier for a person to leave the disk mounted where anyone can then see it. With FileVault forcing a password on wake from sleep, it will likely be encrypted if anyone found it.
    I'm not sure why you went to the trouble you did before, except the instructions might have been to create an encrypted partition as opposed to creating the disk image. Disk images have been around for at least a decade.
    If you plan on backing up the image with Time Machine, use a sparse bundle disk image as it will write the data to small files, called stripes. Only the stripes that change get backed up instead of the entire image.

  • ** How to encrypt data when saving it in DB directly?

    Hi All,
    I want a method to encrypt data in the database when saving it directly
    that is when any one enabled to see the data he will see it encrypted!

    Hi..
    What is the oracle database version???
    As you want the users to see the encypted data, the best option is use DBMS_CRYPTO to encrypt the data.
    [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm]
    [http://www.oracle-base.com/articles/10g/DatabaseSecurityEnhancements10g.php]
    HTH
    Anand
    Edited by: Anand... on Oct 19, 2009 2:11 PM

  • How to handle HTTP-POST encrypted data for ECC Using proxy or RFC

    I have a scenario HTTP-POST ->PI->ECC.sender is HTTP Post  send encrypted data i need to handle the data and stored in to SAP ECC  with out decrypt using PI .what should i take for receiver  can i use inbound proxy or RFC  and how can handle the encrypted data  for decrypt.
    Regards
    Ravi

    1. my sender is HTTP POST . what should i configure in sender communication channel in SAP PI .like SOAP or HTTP .What are the parameters i need to pass .
    >>>
    If you are on PI 7.3 and above, configure the HTTP AAE adapter - Configuring the Java HTTP Adapter on the Sender Channel - Advanced Adapter Engine - SAP Library
    2.while using inbound proxy for encrypted data  i need  store the data in to table , the same proxy can i call  another outbound  service for decrypt  same data.
    >>>>
    Yes you can always a proxy within a proxy.

  • Insert an encrypt data in a Table

    Hi all,
    i have encrypted a data with HmacMD5, all its fine. but when i've tried to insert encrypt data in my table, hash code may return symbols like �?��Z��x��. then when i do a select data has been corrupted. how can i encrypted in stardand symbols( like mysql passwords). here is my code:
                KeyGenerator kg = KeyGenerator.getInstance("HmacMD5");
                SecretKey sk = kg.generateKey();
                // Get instance of Mac object implementing HMAC-MD5, and
                // initialize it with the above secret key
                Mac mac = Mac.getInstance("HmacMD5");
                mac.init(sk);
                byte[] result = mac.doFinal(dirMAC.getBytes());
                String macenc=new String(result);
                String x = "jdbc:mysql://localhost/"+
                        "mydatabase?user="+user+"&password="+
                        pass;
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                conn = DriverManager.getConnection(x);
                conn.createStatement().executeUpdate("insert into user " +
                        "(User,Password) values('system','"+myPass+"')");
                java.sql.ResultSet rs=conn.createStatement().executeQuery("select password "+
                         "from " +"user where user ='system' ");
                rs.next();
                if((rs.getString(1).equals(macenc))) {
                    System.out.println(rs.getString(1)+" YES "+macenc);
                } else {
                    System.out.println(rs.getString(1)+" NO "+macenc);
                }Output NO. and sometimes when hash has (') character Query not found.
    thanks.

    Thie is most probably the offending line
    String macenc=new String(result);
    It is never a good idea to try to convert arbitrary bytes into a String using this approach. Not all byte sequences have valid char representation. If you must have a String representation use Base64 or Hex encoding of your Hmac. Google for Jakarta Commons Codec to get a library to assist you with this.

  • Problem in encrypting my memory card

    hello i have nokia e71. i was encrypted my memory card with password and file. I have the file and passowrd as well. But my keyfile is fine but my password is not working for that please help me i m putting the correct password. I did not change my firmware or anything. Actually my phone was hang during downloading when i restart my phone. My phone was not accepting my memory card please help me?

    Am in a big mess,yesterday i bought E63,but my prior phone was E71,i now decided to use my E71 memory card with E63,when i inserted it,i went to encrypt the memory card but unfortunately,my phone got re-started along the line...now my music player does'nt update the musics on my phone and memory card,i can'nt install java files,not until i remove the memory card...please advise me am bursted.

  • Encrypting data in CSV files

    I am creating a script that reads username and passwords from a CSV file. The passwords will change (and possibly the usernames as well) so instead of re-recording the script to use the new username/password, I wanted an external file to update.
    This works good but the passwords are in CLEAR TEXT in the CSV file.
    Is there a way to encrypt the password (or username and password) in the CSV file?
    If so, is there an external application that can encrypt this without the need for the ATS Desktop application?

    KZack
    Right now you can not encrypt data in a CSV file, however this is a feature well talked about and i'm sure it will be available soon.
    Regards
    Alex

  • Export and Import encrypted data

    Hi,
    I have a database table with encryped data (encrypted using DBMS_OBFUSCATION_TOOLKIT.DES3Encrypt). I am having an issue when I export this table and import it into a new schema. The encrypted data seems to have changed after import. I am unable to decrypt it from the new schema.
    Below is the character set details from export/import.
    "Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set. Server uses WE8ISO8859P1 character set (possible charset conversion)."
    "Import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set."
    Has anybody had this issue before? Does it have anything to do with the character set? If so, how do I fix it?
    Thank you!

    Hello,
    since this question is about using the export utility, you might better ask this in {forum:id=61} or {forum:id=732}.
    Regards
    Marcus

  • Need pl/sql code to Encrypted data to decryption formate

    Hi All,
    I have Encrypted data 64 bit formate like
    encrypt
    780D0287
    FA57C55510D258C73DE93059E3DC49EC
    need output as a Decryption data..kindly give me output

    This is your duplicate post...
    Re: Need pl/sql code to decryption
    *009*

  • Encrypt/decrypt mem card

    hi, just got E71 a week ago..having trouble with the encryption key so i tried deleting the key file in file manager and now i tried creating a new code and now getting incorrect key file. how can i use the memory card again without doing a reformat on the card?
    badly needed your help guys!
    Thanks,
    Eman

    I encrypted my memory card and now that I want to put it on it says ¨memory card encrypted with another key. To decrypt it, import its key. Importing the new key will destroy the curent key in driver. Contnue?¨ I press yes and then it says No Keys Found... hen when I try to put the phone memory off it says ¨To encrypt phone memory it is highly recommended to enable Äutolock¨ and let lock code in ¨Phone andSIM card¨ settings to prevent unuthorized access.¨.
    I then  enable autolockand then I try to ock the pone and SIM card , then the phone autolock period and it asks me for the code and it says its incorrect
    what can I do, should I cnge of SIM card? Help! 

Maybe you are looking for