How to encrypt/decrypt 4 character field in ABAP?

Hello SDN Community,
I have done extensive searches before posting this.  Have even explored fuction modules FIEB_PASSWD_ENCRYPT/DECRYPT.  Even looked at SSF Developers Guide - chapter 4.  The FIEB function modules were dead-end.  SSF looks like it concerns securing of documents or files.  Talks about certificates.
I also looked at the SSF_BASE64_ENCRYPT/DECRYPT function modules on my system, which is ECC 6.0.  Wasn't sure if they could be used on a stand-alone basis, plus I couldn't find any documentation about them.
I only want to encrypt, and then decrypt, the values in a 4 character field.   
    eg- DATA: MYFIELD(4) TYPE C.
Is there an ABAP function module, or coding example, that would demonstrate this?
Or possibly I overlooked something in the information that I have already found?
Thank you,
Dean Atteberry.

Hi Morten,
I would recommend reading the comments to the blog as well, as there would not be much difference between a 4 char field and...
*-- check string-to-string algorithms
  string_in = 'Au weia, der Hahn legt keine Eier'. "#EC NOTEXT
  string_out = test_object->encrypt_string2string( string_in ).
  string_expected = 'AQYRHTFUERodER9UABMRGFQaHBU8VAYREFRYFR0RA1QBNQ=='.
  if string_out <> string_expected.
    result = abap_false.
    return.
  endif.
...if the result can be expected (in any SAP system) or easily reversed.
But it might fullfill a requirement for obfuscation, which is what I was asking as well.
Cheers,
Julius

Similar Messages

  • Hi Freinds......How to Encrypt/Decrypt Text file in j2me

    Hello friendz.,,
    I m having problem with textfile exncryption decryption in j2me..
    Can abybode tell me how to encrypt/decrypt Text file using J2ME API's.......
    PLZ help me .......
    Thanx in advance
    regards,
    Parag

    http://www.mobilefish.com/developer/bouncycastle/bouncycastle.html
    http://www-128.ibm.com/developerworks/library/j-midpds.html

  • How can i compare the character fields?

    I have a requirement to compare the character fields .
    I have to compare the 2 character fields of a table CDPOS
    As follows .
      If CDPOS-VALUE-OLD  GT  CDPOS-VALUE-NEW
          Populate    REDATED = ‘YES’.
    ELSE
          Populate  REDATED = ‘NO’.
    My doubt here is how can we compare the character fields.?
       When I do Extended Program Check: I am getting error like this ?
    Greater than/less than comparisons with character type operands may not be portable
    Please give me idea .
    Thanks ,
    Suresh Kumar.

    Hi suresh,
    DATA : a TYPE char10  VALUE 'DBCD',
           b TYPE char10  VALUE '4234',
           c TYPE char10  VALUE '3456',
           d TYPE char10  VALUE 'ADA',
           e TYPE char10 VALUE  '234567'.
    IF b GT c.        "this case checks for numeric values
      WRITE :/ 'B is bigger'.
    ELSE.
      WRITE :/ 'C is bigger'.
    ENDIF.
    IF a GT d.      "this case checks for alphbetical order
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF strlen( a ) GT strlen( d ). "this case checks for no of chars
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF a GT c.      "this case first alph then numerics
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.

  • How to Encrypt - Decrypt the Passwords

    Hi,
    i am developing an integration between SAP and SFTP.
    i want to save the encrypted password of SFTP to database tables and then i want to use the decrypted password to connect SFTP.
    how to convert the encrypted password to decrypted?
    can somebody help me please?
    Best regards.

    Hi
    you will have to encrypt the entered password first and compare the encrypted passwords.
    Im not sure, but maybe FM VRM_COMPUTE_MD5 will do the encrypting-job.
    just check it out and also check below FM
    Try the DB_CRYPTO_PASSWORD function module, there's no way to decrypt it back that I know of. You just pass the user input to the function module and compare the encrypted output to the value stored in the database.
    and also try this two
    Use the following FM to encrypt
    CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'
    Use the following FM to decrypt
    CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'
    By these FM you can encrypt & decrypt any fields of the Program.
    Warm Regards
      NZAB

  • How to encrypt/decrypt the password

    Hi
    In our website(JSP,servlet) is running over the Sun One Application server.In website, Contact us information is call by a servlet.when we submit the information and it will connect to the DB. I need to use encrypt/decrypt the password. DB connection information is store in server.xml.
    So how to proceed to encrypt/decrypt the password?
    please advice/suggestion for the same.
    thanks
    lalit
    Edited by: Lalit107 on Aug 6, 2009 4:49 AM

    I don't understand what you are saying. Is your password sumitted from the JSP?

  • How to encrypt/decrypt xml data into, and then out of IDS?

    Hi,
    How would we encrypt NPPI information being passed from an unencrypted xml through IDS, and then decrypt it on exit prior to Gendata.
    The IDS SDK gave a reference to IDSEncryptionRule(), but insufficient examples of implementation.
    It could be something like a single tag element, or even the entire xml, it's just not clear how to make it happen using native IDS methods.
    Any thoughts or help to implement this security measure would be most welcome!
    Thanks so much!
    Edited by: lodit on Apr 10, 2013 2:56 PM

    Hi there,
    You would need to write a custom IDS rule that implements this function. You can refer to the IDS SDK book for info on writing a custom rule. IDSEncryptionRule does operations based on the request state received. Normally when an IDS rule is executed, the rules in the request type definition are executed with the RUN_FORWARD request state. Then they are executed with the RUN_REVERSE request state. An example of why this model is used would be the ATCReceiveFile. On RUN_FOWARD, it writes the contents of file segments in a message to a temporary file. Subsequent rules execute. Then on the RUN_REVERSE, the ATCReceiveFile does clean up routines to remove the temporary file.
    So, armed with that knowledge, you can use the IDSEncryptionrule to perform on RUN_FORWARD (decrypt message variables for subsequent processing by Documaker) and then on RUN_REVERSE (encrypt message variables to send back to the client).
    It should be apparent at this point that you need to use an encryption/decryption mechanism with the IDS client otherwise you won't be able to prepare the message to send or read the response. On the client side there are functions - consult the examples included in the IDS SDK (DSI_DSK in the installer package).
    --Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • RMI client-side - how to encrypt,decrypt  in client-side

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. Did I misunderstand?
    if it make for use in applet only, how is possible to do like this " card use privatekey to sign message and send to reader , reader use card's publickey to verify that card sign this signature or not."
    or
    "card use reader's publickey to encrypt message and send to reader, then reader use privatekey to decrypt message (reader authencate itself) "
    because I can't do any of cipher , keybuilder in RMI-client side(reader)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    after that I swap this line with
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    since it will do this first (i swap the line already) it also throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    also be the same result with swap
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    to a first line
    it throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    Please help me
    RSAPrivateKey pri_key;
    RSAPublicKey pub_key;
    KeyPair kp;
    Cipher RSAcipher;
    RSAcipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    pub_key =(RSAPublicKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC,KeyBuilder.LENGTH_RSA_512, false);
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    kp.genKeyPair();
              pri_key = (RSAPrivateKey) kp.getPrivate();
              pub_key = (RSAPublicKey) kp.getPublic();
    //ENCRYPT
    RSAcipher.init(pri_key, Cipher.MODE_ENCRYPT);
    t_cipherLengthRSA = RSAcipher.doFinal(plaintxt,(short)0, (short)plaintxt.length, t_cipherText, (short)0);
    //DECRYPT
    RSAcipher.init(pub_key, Cipher.MODE_DECRYPT);
    RSAcipher.doFinal(ciphertxt,(short)0,(short) t_cipherLengthRSA, temp1, (short)0);

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw
    exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHMYou can not share code between card and client. On the card use the classes of javacardx.crypto and on the client side those of javax.crypto and java.security.
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. That is right.
    if it make for use in applet only, how is possible to
    do like this " card use privatekey to sign message
    and send to reader , reader use card's publickey to
    verify that card sign this signature or not." or
    "card use reader's publickey to encrypt message and
    send to reader, then reader use privatekey to decrypt
    message (reader authencate itself) "On each platform you have classes that provide the same cryptographic operations but the interface of these classes is different (because of the limitations of the java card platform).
    because I can't do any of cipher , keybuilder in
    RMI-client side(reader)Use the java.security.KeyFactory instead.
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 -
    javacard.security.CryptoException.NO_SUCH_ALGORITHMCryptographic support on java cards is optional. Not every card supports every algorithm. Try to use another algo.
    Jan

  • General Question about how to encrypt-decrypt and Digital signatures

    Hi,
    We're developing classes for encrypting and signing a txt message and for decrypting and validating the signature of the message. Everything works properly but I have several questions, they're not about code:
    1st We're encrypting the message following this way:
    -generating a number which is gonna be the password
    -encrypting the message in AES with this password
    -encrypting the with the public certificate of the receiver the password
    -We pack everything, encrypted message+ encrypted password in a File with public key of the receiver.
    The questions we have for this issue are:
    -Is it okay? or can I do it more efficiently.
    -is it a standard for developing encrypting software? We've followed java api tutorials
    -Can we decrypt this message using comercial software? it just plain text(of course if we have the private key)
    2nd We take this message and we sign it with our private key
    -We use CMS classes from bouncycastle libraries
    The questions we have for this issue are:
    - How can I check , with comercial software, whether this message is signed ok and is valid.
    - How can I know whether this way of signing is in compliance with PKCS7-CMS standard?
    Thanks in advance
    if you need more information ask me

    The file multiscreen.html apepars to do the following:
    It tests if the browser is running on a "hand held device".
       This means it looks to see if the device name includes:
              "blackberry","android","iphone","ipad","symbian","smartphone","ios","windows ce","webos"
    If the answer is Hand-held then the HTML5 published module is loaded. Otherwise it loads swf.
    I can see no check that Flash player is loaded before making the choice, nor does it check the compatability of the HTML5 on the "hand held" device. In other  words it isn't very "smart"

  • How do I protect my FLV files? or How to encrypt and decrypt FLV files using AIR?

    Hi,
         I am working on an AIR application, which is developed on eLearning concept. The application mainly deals with flv files. The application contains a video player component, which will stream flv files from an Apache Server and played in my application. Here my concern is I would like to protect my flv files some how against users who may stream them from Apache Server and use them without my application.
         I thought of with an idea to do it. But I don't know whether it will work or not. So I am requesting for your suggestions and better ways to do this with a sample.
    Here is my thought:
    I would like to place the encrypted FLV files at Apache Server side [ Need to know how to encrpt the FLV files using Flex]
    As my AIR application send a request for a FLV file, the Apache server should send the decryption key and a stream of FLV file.
    AIR application should take the decryption key, stream of flv file and it should capable enough to decrypt the FLV file and play it in my application. [ But I don't know how to encrypt/decrypt FLV files through flex]
    I can do encryption of FLV files using Mac Address of Apache Server system and using Java. But I don't know how can I decrypt the same FLV file ( Encrypted using Mac Address and java ) at AIR application side.
    So I would be greatfull If any body help me in encrypting and decrypting of FLV file with a sample using Flex 3.0.
    Thanks
    Sudheer Puppala

    russellfromblackburn south wrote:
    Is it because the portable drive is NTFS format and the Mac wont recognise this? If so what do I do?
    Yes, this is exactly what is causing the problem. Macs cannot write to NTFS formatted drives, only read. You must move the documents to the internal HDD/SSD of the Mac to be able to edit them.
    Or, since you say you don't want to move the documents to the internal storage, you'll need to format the external HDD as FAT32.

  • How to encrypt user credentials when he logs on the Enterprise Portal

    Hi all,
    I want to use a cookie approach on SAP Enterprise Portal i.e. when the user first logs on, i would create a cookie and store the encrypted password in it so that next time he hits the portal, he is directly authenticated with the help of the cookie.
    For this above functionality, i need to know how the encryption & decryption techniques can be achieved by using the SAP Encryption libraries.
    Would be highly appreciative if i get some info on this.
    Thanx & regards,
    Jitendra Chaudhari
    India

    You can use logon ticket for the implementation you want to do. For security issues you are talking about then you can use the SSL connection for the client who is accessing the SAP Enterprise portal. For SAP Logon Ticket see the login modules CreateTicketLoginModule and EvaluateTicketLoginModule
    Initially set the ume.configuration.active = true
    For the security related issues ypu can set the following properties in the login modules
    1) ume.logon.security.enforce_secure_cookie to TRUE.
    Marks the SAP logon ticket as a secure cookie, to enforce that the client browser sends the cookie only when an SSL connection to the J2EE Engine or the reverse proxy is established.
    2) ume.logon.httponlycookie to TRUE
    If true, the SAP logon ticket is set to HttpOnly. This prevents it from being read by malicious client-side script code such as JavaScript. The setting is only effective for clients that use Microsoft Internet Explorer 6.0 SP1 or higher.
    I would suggest to use the 1st option as SAP also recommend the use of SSL connection for Logon Tickets.
    I wish this could help you a bit.
    Thanks and with regards
    Pravesh

  • Increasing SMS character field - Curve 8330

    How do I increase the character field for my messages on my Blackberry Curve 8330? It's limited right now to 140 spaces.

     Hi and welcome to the forums caspittal!
    Check out this link: Beyond 160
    Here's a couple more links for you to explore:
    Crackberry.com Software
    Blackberry App World
    Have fun. 
    IrwinII
    Please remember to "Accept as Solution" the post which solved your thread. If I or someone else have helped you, please tell us you "Like" what we had to say at the bottom right of the post.

  • How To Encrypt /Large The Large Files(eg:40MB)...

    Hi Everybody,
    How To Encrypt/Decrypt the (Size More Than 40 MB)files using sun jce/cryptix jce ?
    I have tried upto 22 mb file.But I had OutOfMemoryException.
    How To Avoid it?
    Plz help.
    Thankz
    vengins,Chennai.India

    Hi
    Actually, this has nothing to do with memory parameters. It is an issue of programming technique. Just don't slurp in the file all at once!
    Instead copy it step by step, buffer by buffer. Read it in e.g. 64KB chunks, encrypt the 64KB and write the encrypted buffer out until the file has been completely processed. There was already a discussion on this subject. Just search for it.
    Frank

  • How to encrypt the text in password field in Oracle Forms version 6i

    Need help!
    How to encrypt the text in password field in Oracle Forms version 6i?
    one way is to change the settings in the property palette. Can somebody provide me some script to be run while the form is running which will enable the password to be encrypted?
    Thanks!

    Hello,
    Do you mean "hidden" (replaced with stars) or encrypted (that needs to be decrypted ?
    Francois

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • How to get a currency format for a character field

    for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
    how do i do this?
    if i do SELECT to_char(:c_1,'$999,999')) from dual;
    it gives me ora: 01722: invalid number error
    c_1 is a user parameter of data type character

    Try using TO_NUMBER first, as in something like:
    SQL> VARIABLE c_1 VARCHAR2(6)
    SQL> EXECUTE :c_1 := '633948';
    PL/SQL procedure successfully completed.
    SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
    TO_CHAR(T
    $633,948Hope this helps.

Maybe you are looking for

  • Phone locked up and other issues

    I was having issues with my phone last night. Sync was a problem and I received several messages that sync for calendar and contacts could not be continued because phone was disconnected! Phone was not disconnected nor was the computer in sleep mode.

  • Installation Problems with OS X Tiger

    I'm currently running osX ver 10.1.5 i think. ( the nunber of versions are driving me nuts). Right now, i'm trying to install OS X Tiger ver 10.4. I've put in the disc, watch the window appear, clicked on the install icon, the reboot icon appeared, a

  • Add a new button in BP_HEAD_SEARCH

    Hi Experts, My requirement is to add a new button and disable GROUP button in MainSearchResult view of  BP_HEAD_SEARCH component.The steps i followed are.. 1.Created a Enhancement set in BSPWDVC_CMP_EXT and assign it to BSPWDV_EHSET_ASG in SM30. 2.En

  • Problem with creating oracle database

    I am trying to create a new database in one of customers computers, using Database Administration Assistant. The wizard goes until "Adding Oracle Text" then I get an error message without any description. Then jump out of wizard quickly with no other

  • From PS back to LR: Save as vs. Save

    When returning to LR from editing in PS (Which was sent to PS with command-E)if I want to rename the photo other than the default *-Edit can I just use Save As? Does the photo still get picked up by LR? I want to rename photos with _sharpened or _Noi