Hash function not use MessageDigest

Anyone knows which implementation method of SHA Hash function does not use MessageDigest?
Thanks

If you don't want the MessageDigest interface to a JCE provider, you'll need to reference instead a class based on MessageDigestSPI.
Sun currently allows using directly the "SHA" class in the "sun.java.security" package (as it is based on MessageDigestSPI, you already have a documented API for it:
public class SHA extends MessageDigestSPI
    implements Cloneable {
    public SHA();
    public int engineGetLength(); // returns 20
    public void engineUpdate(byte value);
    public void engineUpdate(byte[] buffer, int offset, int length);
    public byte[] engineDigest() throws java.security.DigestException;
    public void engineReset();
}Also this class implements Clonable, meaning that you can preserve its internal state before calling engineDigest() that will (before returning the final value) reset the internal state and clear the internal "evidence data" in the instance.
To use it:
import java.security.*;
SHA state = new SHA(); // pass argument (0) if you want the deprecated SHA-0 algorithm instead of SHA-1
byte b = ...;
state.engineUpdate(b);
byte[] buffer = ...;
state.engineUpdate(buffer, 0, buffer.length);
byte[] digestBytes = state.engineDigest(); // implicitly calls state.engineReset() before returning

Similar Messages

  • AGO ToDate  function not using aggregates

    I use aggregated table and a detailed table
    I have time hierarchy whose lowest level is date. For sales I
    created year-to-year (YTD) comparision with AGO function. It
    works OK.
    BUT, I want to speed it up, so I used aggregates. I created new
    time table grouped by MONTH and corresponding agg_SALES table. I
    created connections and mapped the fields. It works OK for
    normal queries, that means my queries at month level use
    aggregates. BUT when I add YTD measures or YAGO measure in query, it goes to
    then SALES table whose grain is date.
    How can I force BI Server to use AGO function with aggregates?
    I use OBIEE 10.1.3.4
    Thank you
    Ishaq
    (Question originally taken from ITtoolbox and posted by Gorazd)

    Hi,
    you can not do it in Administration tool but you can set agregation for that field in Answers (fx->Agregation rule->Sum) and effect should be the same. Note that it may not work properly on Oracle 10g as generated SQL is not 100% recognized, on 11g everything is OK (at least in my case).
    Regards,
    Marko
    Edited by: user10449532 on 2008.11.19 06:29

  • Hash function for the DB_HASH access method

    Hello!
    I use BDB 4.5.20 and tried to use a DB_HASH access method providing my own hash function, since I have very specific keys. Keys are UUID, and they all have the same length (16 bytes) and specific binary representation which can be used to generate hash code. After I set own hash function using Db::set_h_hash() I get the call of this function during database open with a very strange data I was not expected.
    Backtrace is:
    storaged.dll!tbricks::storage::StorageBDBBackend::bdb_hash_func(Db * db=0x01dba398, const void * key=0x1318326c, unsigned int size=12) Line 35     C++
    libdb45d.dll!_db_h_hash_intercept_c(__db * cthis=0x01dba418, const void * data=0x1318326c, unsigned int len=12) Line 483 + 0x97 bytes     C++
    libdb45d.dll!__ham_init_meta(__db * dbp=0x01dba418, hashmeta33 * meta=0x01dbb120, unsigned int pgno=0, _db_lsn * lsnp=0x0013f10c) Line 291 + 0x13 bytes     C
    libdb45d.dll!__ham_new_file(__db * dbp=0x01dba418, __db_txn * txn=0x01dbacc8, __fh_t * fhp=0x01dbafb8, const char * name=0x01dbac60) Line 402 + 0x13 bytes     C
    libdb45d.dll!__db_new_file(__db * dbp=0x01dba418, __db_txn * txn=0x01dbacc8, __fh_t * fhp=0x01dbafb8, const char * name=0x01dbac60) Line 284 + 0x15 bytes     C
    libdb45d.dll!__fop_file_setup(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * name=0x01585624, int mode=384, unsigned int flags=129, unsigned int * retidp=0x0013f458) Line 586 + 0x42 bytes     C
    libdb45d.dll!__db_open(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * fname=0x01585624, const char * dname=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=129, int mode=0, unsigned int meta_pgno=0) Line 154 + 0x1d bytes     C
    libdb45d.dll!__db_open_pp(__db * dbp=0x01dba418, __db_txn * txn=0x01dba9e0, const char * fname=0x01585624, const char * dname=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=129, int mode=0) Line 1079 + 0x23 bytes     C
    libdb45d.dll!Db::open(DbTxn * txnid=0x00000000, const char * file=0x01585624, const char * database=0x00000000, DBTYPE type=DB_HASH, unsigned int flags=33554561, int mode=0) Line 313 + 0x30 bytes     C++
    storaged.dll!tbricks::storage::BDBBackend::open_db(Db & db={...}, const char * fileName=0x01585624, DBTYPE dbType=DB_HASH) Line 372 + 0x21 bytes     C++
    Db::set_h_hash() documentation says nothing about behaviour like this.
    Why BDB calls my hash function during database open while I do not put()/get() any data?
    Firstly I was implemented hash function aborting the application if key length is not equal 16, because it looks like application internal error, and for sure application was aborted because of that.
    How should I treat this data and do I have to return any hash code at all in this case?

    A quick look at the code indicates that this call is to run the hash function against a known value ("%$sniglet^&") to store the result in the DB file (or to compare the result against a result stored in the file, if the file already exists). Since a failure of this comparison prints "hash: incompatible hash function", I think we can assume that this is done to ensure the hash function being used is compatible with the hash function used when the DB file was created.
    So you need to be able to provide some form of hash output for this.

  • Hash Function used by oracle

    Hi,
    I am working on partition tables.
    I want to know more abt how hash partitioning works.
    I want to know the exact hash function used by oracle.
    I searched a lot, but couldn't find an exact answer on the net.
    Plz assist.
    Thanks in advance.
    Subha

    EdStevens wrote:
    Justin Mungal wrote:
    saratpvv wrote:
    This file contains port list
    $ORACLE_HOME/install/portlist.iniHey... neat... I didn't know about that.
    But I would still go with netstat just to be sure, as previously suggested. The portlist.ini file listed the EM and EM Agent ports, but didn't list the listener port... tsk tsk portlist.ini!Because you are expecting portlist.ini to be used for something that it is NOT used for ...
    I can't find the documentation now, but it seems I remember reading that oracle uses its portlist.ini file to track what ports it has assigned to various (but not all) of its services. But it is NOT used to actually configure those services. THAT is done with various .config or .xml files. See http://docs.oracle.com/cd/E11882_01/install.112/e24321/app_port.htm#sthref841 for some additional insight.
    Roger. I haven't actually used it, as I had only just heard about it. Thank you though.

  • Secure hash function with salt to create a not spoofable PRC (SAP CRM)

    Hello SAP Security Community,
    SAP CRM Marketing provides a functionality called Personalized Response Code (PRC, 10 characters). This code can be used in mail, fax, sms or letters to customers. When the customer returns the PRC to the communication initiator, it can be mapped to a campaign and the business partner number of the customer. See also the [SAP Standard Help|http://help.sap.com/saphelp_crm700_ehp01/helpdata/EN/2a/c13463f09c4a1f9c45903e7a0a7230/frameset.htm].
    By default this standard implementation of the BAdI CRM_MKT_PRC_CONVERT is called:
    METHOD if_ex_crm_mkt_prc_convert~convert_prc.
      DATA lv_no      TYPE  crmt_mkt_icrh_prc_num.
      DATA lv_string  TYPE  string.
      DATA lv_pos     TYPE  int4.
      DATA lv_base31  TYPE  string VALUE '0123456789BCDFGHJKLMNPQRSTVWXYZ'.
    **** converting the numeric-base10 into base31
      lv_no = iv_prc.
      CLEAR lv_string.
      DO.
        lv_pos = lv_no MOD 31.
        lv_no  = lv_no DIV 31.
        CONCATENATE lv_base31+lv_pos(1) lv_string INTO lv_string.
        IF lv_no = 0.
          EXIT.
        ENDIF.
      ENDDO.
      MOVE lv_string TO ev_prc.
    ENDMETHOD.
    As you can see it does a simple base31 encoding of the provided input parameter iv_prc which is a number provided by the number range for PRC's.
    I want to use the PRC to make our customers registration process for a trade fair easier. We send out the PRC via a letter to the customers where we don't have an E-Mail address. The letter contains instructions which point the user to a Website that has an input field for the PRC. When the user submits the PRC I'd like to show him/her some personal information (Name, Address, E-Mail) that we lookup using the PRC in the CRM System. This information is then posted to a 3rd party website that has to be used to do the trade fair registration.
    If I would use the simple base31 encoding, then the current counter state could be easily decoded, the next number can be chosen and by applying base31 encoding again, the next valid PRC is created. This could then be misused to read personal information of another customer. I think what could solve this problem would be to use a secure hash function that allows also to be salted to create the PRC.
    Do you think I'm on the right track? Or would it be OK to use the classes described in [Note 1410294 - Support SHA2-family for Message Digest and HMAC|https://service.sap.com/sap/support/notes/1410294] and before doing the hashing add a random number to the PRC number that I've got from the number range? What problems do I run in as the PRC could not be longer than 12 characters? For sure I have to check that I don't create any PRC twice.
    Best regards
    Gregor

    Knowledge of PCR should not reveal any personal information to you.
    OK, but in this case the PCR is mapped to the campaign number and the BP-number. It would reveal the information.  Hence a second hash which only allows further processing if it matches. The second hash is a "signature" of the PCR.
    I don't agree with this. The security should NOT be based on hiding how system works. Only key should be secret. In this case it should all depend on quality of PRNG. Check Kerckhoffs's principle. Whenever I see proprietary algorithm in crypto I start to feel nervous about the system.
    Ok, you convinced me. That is also true, but you will have to save the key or the hash it produces to be able to verify it again when the user returns to the website - and in this case it is in clear text ABAP (unless Mr. Wolf wants to create an external program, like SAP does with C-calls).
    From the perspective of the user it is a password and they must be able to transfer it from a snail-mail readable text on paper into a website field.
    As Mr. Wolf has noticed, the next PCRs can be obtained by anyone who can decode standard code (knowing that the BADI is activated).
    I think a correctly placed split and concatenation does the trick for a 20 character field without knowing which part is the PCR and which is the signature (a human can still enter that into a website field).
    I think the big question (appart from the principle - which I agree with you on) is whether the admins and their family members are allowed to bid? Also do the bidders have acces to this system as technical consultants?? (for example to single test methods and function modules in the production system??).
    Also how does the process continue and finally get concluded? Typically there is some "horse trading" in the end anyway... 
    All these factors should influence the strength and complexity of the design, and maintenance of it IMO.
    But generally you are correct and I rest my case.
    @ Mr. Wolf: Are you enjoying the debate too much or are you going to give us more insight?
    Cheers,
    Jules

  • Can not use TOUCH function on Nokia 6600 slide

    Can not use TOUCH function on Nokia 6600 slide-
    turned on sensor in phone settings, but when i touch the PHONE it does not work.
    Please, tell me how use this function or maybe my phone is out of order

    As long as your Sensor Settings are On within Menu, Settings, Phone, Sensor Settings then you just need to do the following -
    Tapping
    The tap function allows you to quickly
    mute and reject calls and alarm tones, and
    to display a clock just by double-tapping
    the back or front of the phone when the
    slide is closed.
    Select Menu > Settings > Phone >
    Sensor settings to activate the tap
    function and vibration feedback.
    Mute calls or alarms
    Double-tap the phone.
    Reject a call or snooze an alarm after
    muting it
    Double-tap the phone again.
    Display the clock
    Double-tap the phone.
    (If you have missed calls or received new
    messages, you must view them before you
    can see the clock.)
    Simply, if you double tap the screen when the slide is closed and you can see the clock appear then it is working.
    I hope this makes it clearer for you.
    Full Manual here - http://nds1.nokia.com/phones/files/guides/Nokia_6600_slide_UG_en.pdf

  • HT203175 I have no problem signing on to iTunes my issue is once on the site I can not use the "search". It says there is a runtime error R6025 pure virtual function call. Has anyone had this problem and how do I fix it. Thanks

    I do not have a problem getting in the iTunes stores. My issue is once on the site I can not use the "search". It says there is a pure virtual function call R6025. How can I solve this problem? Do I have to create a new account? Do I have to uninstall and re-install? Thanks

    Thanks so much for your feedback. I really appreciate any input here.
    If someone from Adobe could GUARANTEE that this problem would go away if I
    purchased CS4, I would pony up the cash and do it. However, I'm skeptical
    about that because I just saw someone else post a message on the forum today
    who is running CS4 and getting the exact same runtime error as me.
    I'll try un-installing and re-installing as Admin, and if that doesn't work,
    maybe I can find a used copy of CS3.
    In the meantime, I'm also wondering if a Photoshop file can carry any sort
    of corrupt metadata inside it once it has errored out? Reason I ask is, I
    had to port all of my old PSD files to the new computer, and I only seem to
    be getting this error when I attempt to work on one of the files that
    previously got the runtime error when they were sitting on my XP machine.
    When I create new files from scratch on this new computer, they seem to be
    working just fine (at least, for now).
    If so, I would probably be smart to never open those troublesome
    "errored-out" files again.

  • Functions are not using default and will not validate without direct input

    Hi. I am recreating all of our mappings (from 9.0 to 11g). And I am finding that any function that does not have a direct input for every input variable (rather than using the defaults as defined in the function) no longer will validate in OWB. It states that the input parameter is required but is not connected.
    I have worked around this so far by adding Constants to pass the default values. I tried setting the default value in the property inspector window for each specific input parameter and this did not work, I still get the same error.
    Is there a way to fix this? i am not happy with having to add all these constants, and I don't see why it is not using the defaults that are defined in the functions themselves. Any help is appreciated.
    Thanks,
    Kaisha

    By the way for anyone who is curious....
    The reason that the functions and sp's weren't working correctly was because I had movedthem into the new DB wrapped. I don't know why it caused this but when I did dbms_metadata and replaced them all unwrapped, and then reimported them into OWB all the mappings compiled.
    K

  • Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
    Attachments:
    channel_name.JPG ‏69 KB

  • Using of Oracle Text functions not working in JDev

    Hi,
    I'm confused about using Oracle Text functions in JDeveloper.
    It's not possible for me to pass the sql syntax test while creating a view object with a custom query:
    SELECT score (1) myScore,
    dokumente.titel,
    ctx_doc.snippet ('idx_dokumente_titel',
    TO_CHAR (dokumente.dkt_id),
    'searchstring'
    ) snippet
    FROM dokumente
    WHERE contains (titel, 'searchstring', 1) > 0;
    I retrieve "ORA-00911:     invalid character" for the contains-function.
    (Using this statement in sql-worksheet works.)
    Any ideas?

    Hi william,
       Yes you need code abap to maintein your data. look at <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/2f/696d360856e808e10000009b38f839/frameset.htm">Business Data Toolset</a>, in the part of Dialog.
    Regards.
    Manuel

  • Function 'function name' may not used in sql

    Hi Guys,
    How to call a function in a form level trigger?
    i created a function in program unit.In timer expired trigger i tried to call a function as
    select sf1('a') from dual;Im getting below error
    function sf1 may not use in sqlAdvance thanks

    Hi,
    If you want to assign the return value of the function to a variable then you can try
    <variable_name> := sf1('a');Else, you can write
    select sf1('a') into <variable_name> from dual;Hope this helps.
    Regards,
    Manu.

  • Anbody used Hash partioning? - what about queries not using partition key

    Hi there,
    We have a table, will have over 3 billion rows when loaded and wish to implement partioning.
    Brief structure
    cal_id -- relates to date of transaction
    prod_id
    cust_id,
    sales_qty
    The id's are all surrogate id's/dimension keys
    About 80% of queries expected to use by on_sale_date of product rather than date of transaction hence considering using hash partition on product_id.
    Queries will hit > 1 partition in general and also some e.g 15% of queries wil be by date of transaction.
    Qusetions I have - how will these 15% of queries be affected. I expect will be poorer performance-wise because of partioning but becuase of size of table and 80% queries by product have to use partition.
    Also will partition-pruning work if queries use between rather than = operator
    Anbody used hash partioning - keen to hear other people's ideas/experience with hash partioning.
    Many Thanks

    Hi,
    When partition pruning is not used, then that depend on the access path.
    If it does a full table scan, then there is nearly no overhead to full scan all partitions (compared with full scanning the same non-partitioned table)
    If it is an index access and if indexes are local, then all indexes must be read. But with global index, again, there is no overhead in comparison with a non-partitioned table (except that indexes are a bit larger when global on partitioned table)
    However can be expected to partition even when reading all partitions, especially with parallel query.
    the between is not optimal with hash partitions, s it is hash partition, not range partition.
    Regards,
    Franck.

  • HT204168 touch screen function not working when using facetime

    Why is my iPad touch screen function not working when using FaceTime?

    Hi megascones,
    I apologize, I'm a bit unclear on the exact nature or scope of the issue you are describing. If you are having issues with the touch screen on your iPad, you may find the troubleshooting steps outlined in the following article helpful:
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Regards,
    - Brenden

  • Why is my touch screen function not working when using facetime

    Why is my touch screen function not working when using facetime

    Hello megascones,
    After reviewing your post, it sounds like the screen is not responding to touch in one app. I would recommend that you read this article, it may be able to help the issue.
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Restart your device. If you can't restart, reset your device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Downloaded 3.6.13 today and now I can not use my right click function when trying to open a new tab!

    When browsing the net I can not use my right click function on a link to open a new tab. How can I fix this? It was working fine until I downloaded 3.6.13 Firefox this am.

    I un-installed the yahoo toolbar and my problem was solved!!!!

Maybe you are looking for

  • My Macbook Pro 2012 is painfully slow and the battery dies out really fast

    I don't do a lot of downloading or installing on my computer, I basically just use it to browse the internet or use microsoft office. I haven't used much memory and all the specs on my computer seem fine. I recently went to the genius bar at an apple

  • Cannot import music (appears to be mostly .wma)

    Hello, I figured out by reading here that itunes couldn't import .flac files, so that's been sorted, but from what I can tell, I should have no problem importing .wma files. But when I do:  file > add to library > and then select either the folder or

  • How can I sort albums on ipad in A-Z order ?

    I have 200 albums in my iPad. They are multiple pictures of individual cars. I have them titled by year and make. Is there a way to sort them by title instead of moving them around by hand?

  • ORA-01403

    Many times asked, but I could not get a solution! CREATE or REPLACE PROCEDURE sp_overdue_test( p_scriptname IN VARCHAR2) IS v_reportdate DATE := sysdate; v_pad_day NUMBER; v_error_msg VARCHAR2(200); err_num Varchar2(100); err_msg Varchar2(150); BEGIN

  • Sample Rates not Matching

    I'm using Firewire from my Sony HVR M15U to FCP 6. After ever capture I'm getting a message "that 1 or more of the media files does not match the sample rate of your source tape". It also warns that audio may be out of sync with video. However, that