Quantcast
Channel: SCN: Message List - HMAC (SHA1) key longer than 81 characters not possible?
Viewing all articles
Browse latest Browse all 10

HMAC (SHA1) key longer than 81 characters not possible?

$
0
0

Not sure whether I'm in the correct forum...

 

To sign a message for a specific application with HMAC-SHA1 hash I need a 83 character key.

 

My problem: the function module 'SET_HMAC_KEY' throws the exception "param_length_error". After I've testet with several key length, I found out, that the maximum valid length is 81. Is there any reason for this?

 

With 3rd party libraries (ie. Python and Javascript) longer keys are working.

 

Code:

 

CALL FUNCTION 'SET_HMAC_KEY'  EXPORTING    generate_random_key         = ' '    alg                         = 'SHA1'    keycstr                     = 'cB1phTHISISATESTVuZMDmWCz1CEMy82iBC3HgFLpE&7857T...YFqV93gRJQ'    client_independent          = ' '  EXCEPTIONS    unknown_alg                 = 1    param_length_error          = 2    internal_error              = 3    param_missing               = 4    malloc_error                = 5    abap_caller_error           = 6    base64_error                = 7    calc_hmac_error             = 8    rsec_record_access_denied   = 9    rsec_secstore_access_denied = 10    rsec_error                  = 11    rng_error                   = 12    record_number_error         = 13    OTHERS                      = 14.

 

 

Best regards, Uwe

 

Edited by: Julius Bussche on Aug 5, 2010 10:19 PM

I truncated the key further because in a coding tag it toasts the formatting when too long.


Viewing all articles
Browse latest Browse all 10

Trending Articles