Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 26th, 2008, 03:37 AM
bgmerodio bgmerodio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 1 bgmerodio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 46 sec
Reputation Power: 0
How to generate a 1152 RSA length key

Hello!

I need to generate a 1152 bits length RSA in a Z/OS system key but i don't know how to do it.
I've tried to generate it using the TKE but it only allows to generate a length key up to 1024 bits. It i try to generate a 1152 it returns an error.
Is it possible to do it through TKE??

I've tried another method:
I am calling CSNDPKG service which is an ICSF callable service from a rexx program to generate the key But I am getting return code 8 with reason code 11000 which is 'The value specified for length parameter for a key token, key, or text field is not valid.'
I am not sure about the values to be given.


I generate the token with this rexx. It ends wit rc=0


return_code='FFFFFFFF'x
reason_code='FFFFFFFF'x
exit_data_length='00000000'x
exit_data='00000000'x
rule_array_count=int(1)
rule_array=left('RSA-CRT',8,' ')
key_value_structure='04800000000000000000000000000000'x||,
'0000'x
key_value_structure_length=int(length(key_value_structure))
private_key_name=left('RSA.BORJA.PRIVATE',64)
private_key_name_length=int(length(private_key_name))
reserved_1_length=int(0)
reserved_2_length=reserved_1_length
reserved_3_length=reserved_1_length
reserved_4_length=reserved_1_length
reserved_5_length=reserved_1_length
reserved_1=''
reserved_2=''
reserved_3=''
reserved_4=''
reserved_5=''
key_token=copies('FF'x,2500)
key_token_length=int(length(key_token))
say length(key_token)
parm='return_code reason_code exit_data_length exit_data '||,
'rule_array_count rule_array '||,
'key_value_structure_length key_value_structure '||,
'private_key_name_length private_key_name '||,
'reserved_1_length reserved_1 reserved_2_length reserved_2 '||,
'reserved_3_length reserved_3 reserved_4_length reserved_4 '||,
'reserved_5_length reserved_5 key_token_length key_token'
address linkpgm CSNDPKB parm
say 'CSNDPKB'
say 'return_code='c2x(return_code)
say 'reason_code='c2x(reason_code)

but when i try to generate the key with this rexx, i get a rc=8 and i don't know whats wrong


return_code='FFFFFFFF'x
reason_code='FFFFFFFF'x
exit_data_length='00000000'x
exit_data='00000000'x
rule_array_count=int(1)
rule_array=left('MASTER',8,' ')
regeneration_data='ESTA ES LA TIPICA PASSPHRASE'
regeneration_data_length=int(length(regeneration_data)) skeleton_key_identifier_length= key_token_length
skeleton_key_identifier= key_token
transport_key_identifier=copies('0'x,64) generated_key_token_length= int(length(key_token))
generated_key_token= 'RSA.BORJA.CLAVE'
parm='return_code reason_code exit_data_length exit_data '||,
'rule_array_count rule_array regeneration_data_length '||,
'regeneration_data skeleton_key_indentifier_length '||,
'skeleton_key_identifier transport_key_identifier '||,
'generated_key_token_length generated_key_token'
address linkpgm CSNDPKG parm
say 'CSNDPKG'
say 'return_code='c2x(return_code)
say 'reason_code='c2x(reason_code)
SAY C2X(generated_key_token_length)
exit
introcedure
arg x
if datatype(x)=='NUM' then y=right(x2c(d2x(x)),4,'0'x)
else y=-1
return y
decimalrocedure
arg x
return x2d(c2x(x))

Thank you very much for your help...

Borja

Reply With Quote
  #2  
Old March 28th, 2008, 08:31 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 897 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 22 h 38 m 54 sec
Reputation Power: 416
I'm missing something.

Why not generate the key on some system and transfer the file?

For example, use OpenSSL, generate it, and export it to any format you like.

Usually folks use PKCS #1 and #12, which require ASN.1 format, but OpenSSL handles all that ugly stuff.

You may want to use some other format, especially if you want to read it on a more limited system, as ASN.1 can be painful.

Is it really required that you generate the keys on the Z/OS

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > How to generate a 1152 RSA length key


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway