Jasypt Users Forum

error while using IBM's JDK

View: New views
3 Messages — Rating Filter:   Alert me  

error while using IBM's JDK

by asifsehzaad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i am using BasicTextEncryptor to encrypt and decrypt... but when moving to IBM's JRE i am not getting the securerandom implementation of SHA1PRNG... since for securerandom IBM uses IBMSecureRandom, is there a way to specify this in the BasicTextEncryptor.


Re: error while using IBM's JDK

by asifsehzaad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok,

I found out the problem,... it is the org.jasypt.salt.RandomSaltGenerator and it has a final field named SECURE_RANDOM_ALGORITHM which kinda restricts us to the Sun's JDK... i recompiled these things from the source.... and changed it from final to a normal field, having a getter setter.

this is how the code looks like...
   
    private static String SECURE_RANDOM_ALGORITHM = "SHA1PRNG";
            .
            .

        public static String getSecureRandomAlgorithm() {
                return SECURE_RANDOM_ALGORITHM;
        }


        public static void setSecureRandomAlgorithm(String secure_random_algorithm) {
                SECURE_RANDOM_ALGORITHM = secure_random_algorithm;
        }

   
}

I am newbie sort of guy to java, can i join as a developer to this open source effort....


asifsehzaad wrote:
i am using BasicTextEncryptor to encrypt and decrypt... but when moving to IBM's JRE i am not getting the securerandom implementation of SHA1PRNG... since for securerandom IBM uses IBMSecureRandom, is there a way to specify this in the BasicTextEncryptor.

Re: error while using IBM's JDK

by dfernandez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

+------------------------+
  Jasypt Users List      
  http://www.jasypt.org 
+------------------------+

Hello,

You are right, this random number generator algorithm is hard-coded...
that can be an improvement for next versions of jasypt. I will try to
include it in next version.

Regards,
Daniel.


asifsehzaad wrote:

> +------------------------+
>   Jasypt Users List      
>   http://www.jasypt.org 
> +------------------------+
>
> Ok,
>
> I found out the problem,... it is the org.jasypt.salt.RandomSaltGenerator
> and it has a final field named SECURE_RANDOM_ALGORITHM which kinda restricts
> us to the Sun's JDK... i recompiled these things from the source.... and
> changed it from final to a normal field, having a getter setter.
>
> this is how the code looks like...
>    
>     private static String SECURE_RANDOM_ALGORITHM = "SHA1PRNG";
>             .
>             .
>
> public static String getSecureRandomAlgorithm() {
> return SECURE_RANDOM_ALGORITHM;
> }
>
>
> public static void setSecureRandomAlgorithm(String secure_random_algorithm)
> {
> SECURE_RANDOM_ALGORITHM = secure_random_algorithm;
> }
>
>    
> }
>
> I am newbie sort of guy to java, can i join as a developer to this open
> source effort....
>
>
>
> asifsehzaad wrote:
>  
>> i am using BasicTextEncryptor to encrypt and decrypt... but when moving to
>> IBM's JRE i am not getting the securerandom implementation of SHA1PRNG...
>> since for securerandom IBM uses IBMSecureRandom, is there a way to specify
>> this in the BasicTextEncryptor.
>>
>>
>>
>>    
>
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jasypt-users mailing list
jasypt-users@...
https://lists.sourceforge.net/lists/listinfo/jasypt-users
LightInTheBox - Buy quality products at wholesale price