[erlang-questions] RSA encryption / missing methods

Richard Bucker richard@REDACTED
Thu Mar 6 00:26:27 CET 2008


crypto:mod_exp() is, randomly, not returning my data when decrypting  
and so I need help getting direction on how to debug this type of  
application.

My application works like this:

1) generate a DEK (data encryption key) pub/priv key using openssl via  
os:cmd()
2) generate a KEK (key encryption key) pub/priv key using openssl via  
os:cmd()
3) use the pub & mod from the KEK to encrypt the priv of the DEK

and in use...

1) encrypt my data with the crypto:mod_exp(Data, Pub, Mod).
2) then decrypt the message crypto:mod_exp(Data, Priv, Mod).
3) compare the before and after


---[SNIP]---
	Msg = "my message",
         C2 = key_tools:mini2_encrypt(Msg),
         P2 = key_tools:mini2_decrypt(C2),
         Msg = binary_to_list(P2),
---[SNIP]---


so far so good, however, every so often it fails to 'match'

/r



More information about the erlang-questions mailing list