Sun
Knowledge is power - France is bacon
- Joined
- Jan 26, 2015
- Messages
- 333
- Solutions
- 22
- Reaction score
- 244
After recent changes to tfs 1.3 by @Lordfire the rsa private key is now loaded from PEM file & it might be a bit confusing for some to generate custom rsa
This tutorial requires openssl to be installed on your system.
Debian & Ubuntu have it pre-installed.
First generate your private key
Export the RSA Public Key to a File
Now to extract modulus from the public key
That should print something like this:
0:d=0 hl=3 l= 159 cons: SEQUENCE
3:d=1 hl=2 l= 13 cons: SEQUENCE
5:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
16:d=2 hl=2 l= 0 prim: NULL
18:d=1 hl=3 l= 141 prim: BIT STRING
See the line with BIT STRING? Use the first number in the next command
Your result should be similar to this:
0:d=0 hl=3 l= 137 cons: SEQUENCE
3:d=1 hl=3 l= 129 prim: INTEGER :A67E67F1BB0330A9BFEAB7306DDE4DE4EED66714519E0A97B096DCAAE35014EE
400BA718DBBFBD1065CAEB6029CAF6A6D5FA8F53C9154FB04BAB993CC051453CF00B71E1DC11DA0962BBFC770D8B855D65C1D953AEBB3CCD1A6BC70C3CB5EAC2B97FC1FAA20C322A732D4CF160DAE16FD028E13D54B52EC815BBF57CDD37184F
135:d=1 hl=2 l= 3 prim: INTEGER :010001
copy the hex from the first INTEGER (the string that starts with A6)
if you're using debian or ubuntu you can run this command
otherwise there are different alternatives.
If the link above doesn't work just google hex to decimal converter and you should find something.
The long ass number you get from the conversion is your modulus that you use to replace the one in your client.
don't forget to change the default key.pem with your newly generated key.pem
This tutorial requires openssl to be installed on your system.
Debian & Ubuntu have it pre-installed.
First generate your private key
Code:
openssl genrsa -out key.pem 1024
Code:
openssl rsa -in key.pem -outform PEM -pubout -out public.pem
Now to extract modulus from the public key
Code:
openssl asn1parse -in public.pem
0:d=0 hl=3 l= 159 cons: SEQUENCE
3:d=1 hl=2 l= 13 cons: SEQUENCE
5:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
16:d=2 hl=2 l= 0 prim: NULL
18:d=1 hl=3 l= 141 prim: BIT STRING
See the line with BIT STRING? Use the first number in the next command
Code:
openssl asn1parse -in public.pem -strparse 18
Your result should be similar to this:
0:d=0 hl=3 l= 137 cons: SEQUENCE
3:d=1 hl=3 l= 129 prim: INTEGER :A67E67F1BB0330A9BFEAB7306DDE4DE4EED66714519E0A97B096DCAAE35014EE
400BA718DBBFBD1065CAEB6029CAF6A6D5FA8F53C9154FB04BAB993CC051453CF00B71E1DC11DA0962BBFC770D8B855D65C1D953AEBB3CCD1A6BC70C3CB5EAC2B97FC1FAA20C322A732D4CF160DAE16FD028E13D54B52EC815BBF57CDD37184F
135:d=1 hl=2 l= 3 prim: INTEGER :010001
copy the hex from the first INTEGER (the string that starts with A6)
if you're using debian or ubuntu you can run this command
Code:
python -c 'print(int("pasteHERE", 16))'
If the link above doesn't work just google hex to decimal converter and you should find something.
The long ass number you get from the conversion is your modulus that you use to replace the one in your client.
don't forget to change the default key.pem with your newly generated key.pem