FAQ  •  Register  •  Login

Blowfish Decrypt Algorithm

<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Sun Jan 29, 2012 2:47 pm

Blowfish Decrypt Algorithm

I would like to use a Blowfish Decrypt Algorithm ( mode ECB) for a plugin development, how can I add it on my groovy script?
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Jan 29, 2012 4:44 pm

Re: Blowfish Decrypt Algorithm

Im not sure if its a part of core Java. If yes it should not be a problem. Check the plugin guide, there is a link to Javadoc. Otherwise look at 4od plugin which includes algorithm similar to Blowfish.
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Sun Jan 29, 2012 7:52 pm

Re: Blowfish Decrypt Algorithm

Found !!
File decrypted !
import java.security.Key
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher

Thanks
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Jan 29, 2012 9:47 pm

Re: Blowfish Decrypt Algorithm

Cant you use one of the shared methods in the plugin sdk? It uses these classes as well.
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Jan 30, 2012 9:04 am

Re: Blowfish Decrypt Algorithm

Are you talking about these shared methods?
String decryptAES(String hexText, String key, String iv)
String generateMAC(String text, String hash, String algorithm)

I don't know how to use them.

EDIT: I use this method:
import java.security.Key
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher

  Code:
   public String MyDecrypt(byte[] data,byte[] key){
      try
      {
         Key clef = new SecretKeySpec(key,"DES");
         Cipher c = Cipher.getInstance("DES");
         c.init(Cipher.DECRYPT_MODE,clef);
         return new String(c.doFinal(data));
      }
         catch (Exception e)
      {
         System.out.println(e);
      return null;
      }   
   }



"DES" algorithm could be added to the method parameters.

http://docs.oracle.com/javase/1.4.2/doc ... Guide.html
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jan 30, 2012 9:50 am

Re: Blowfish Decrypt Algorithm

ok, that is a bit different, i'll add this to a future version.

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 14 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.