How finally block can be evaded??

i want to write a finally block but don't want to execute it.
plz dont suggest application.exit(). i want to continue with my program
plz answer

I want to write a finally block but don't want to execute it.You have several options.
- don't enter into the try block associated with your finally block
- embed the content of the finally block with "if (false) { ... }" - well the finally block is executed, but the contents of the if block is not
- throw an exception right at the start of the finally block - almost the same as above
- investigate if this is of any use for your objective: "An application should not normally try to catch ThreadDeath unless it must do some extraordinary cleanup operation (note that the throwing of ThreadDeath causes finally clauses of try statements to be executed before the thread officially dies). If a catch clause catches a ThreadDeath object, it is important to rethrow the object so that the thread actually dies." from: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#stop()

Similar Messages

  • HT4722 How many computers can you install Final Cut on

    How many computers can you install Final Cut on with one license or purchase?

    This is an excerpt from the FCPX license, available here.
    http://images.apple.com/legal/sla/docs/FinalCutPro.pdf
    2. Permitted License Uses and Restrictions.
    A. Mac App Store License. Subject to the terms and conditions of this License and as permitted by the Mac App Store Product Usage Rules set forth in the App Store Terms and Conditions (http:// www.apple.com/legal/itunes/ww/) (“Usage Rules”), you are granted a limited, non-transferable, non- exclusive license:
    to download, install, use and run for personal, non-commercial use, one (1) copy of the Apple Software directly on each Apple-branded computer running OS X (“Mac Computer”) that you own or control; and
    (ii) if you are a commercial enterprise or educational institution, to download, install, use and run one (1) copy of the Apple Software for use either: (a) by a single individual on each of the Mac Computer(s) that you own or control, or (b) by multiple individuals on a single shared Mac
    Computer that you own or control. For example, a single employee may use the Apple Software on both the employee’s desktop Mac Computer and laptop Mac Computer, or multiple students may serially use the Apple Software on a single Mac Computer located at a resource center or library.

  • How to block the " you are lucky visitor" popup each time I open the Firefox. I can not find any information in the add on lists et al. Thanks!

    Recently, my Firefox browser v25.0 is experiencing a popup problem. A popup message saying "... you are today's luck visotor, please click Ok to ontinue". I have to click Ok then I can continue to use the browser. Is this a popular problem? Please advise how to block this popup. Thanks!

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • How many computers can I load Final Cut Pro on

    If I purchase Final Cut Pro x how many computers can I load it on? Can I put it on my desk top and lap top?

    In regards to FCP X on more than one computer --- currently with the older versions of FCP, if I try to launch FCP on a 2nd computer (that I own) it prompts me that I cannot launch the application on more than one computer at the same time.   Does this prompt appear in FCP X as well if two computers try to use FCP X at the same time?

  • 1 license of final cut pro x, how many computers can hold?

    how many computers can y have whit one license of final cut pro x

    AAs many computers as you own and of which you have operational control.

  • How many computers can use final cut once I purchase the license?

    How many computers can use final cut X once I purchase the license through the App store? Will it give me a code I can use to download the serial on a separate computer? Thanks for the answer.

    TYou can use it in as many computers as you own and control. No serial number, just your Apple ID to download. Or just copy it from one machine to the other.

  • How many times can you install FINAL CUT STUDIO 2

    i have several computers. how many times can this software be installed

    gogiangigo wrote:
    Welcome to the forums,
    Your license allows you to install FCPS2 on one desktop and one laptop.
    G.
    To expand on that, you can install it on two machines but you're only allowed to run it on one machine at a time. In fact, if you have both copies running and the machines connected to the same network, you will get an error message and the application will quit.

  • How to properly use finally block

    I am writing a try-catch-finally block and I don't think it is written properly. I am using a BufferedReader and BufferedWriter like this:
    BufferedReader myInput = null;
    BufferedWriter myOutput = null;
    try
        myInput = new BufferedReader(new FileReader(inputFile));
        myOutput = new BufferedWriter(new FileWriter(outputFile));
        // do stuff here
    catch (IOException e)
        e.printStackTrace();
    finally
        myInput.close();
        myOutput.close();
    }Now the whole point of the finally block is that it gets executed no matter what, so I want to make sure that the input and output file get closed even if there is an exception thrown. However, when I try to compile this code it doesn't work because it complains that there are unhandled exceptions in the finally block.
    What am I doing wrong here? If I have to put yet another try block inside of the finally block...doesn't that defeat the whole purpose of the finally block?

    gamblor01 wrote:
    I am writing a try-catch-finally block and I don't think it is written properly. I am using a BufferedReader and BufferedWriter like this:
    BufferedReader myInput = null;
    BufferedWriter myOutput = null;
    try
    myInput = new BufferedReader(new FileReader(inputFile));
    myOutput = new BufferedWriter(new FileWriter(outputFile));
    // do stuff here
    catch (IOException e)
    e.printStackTrace();
    finally
    myInput.close();
    myOutput.close();
    }Now the whole point of the finally block is that it gets executed no matter what, so I want to make sure that the input and output file get closed even if there is an exception thrown. However, when I try to compile this code it doesn't work because it complains that there are unhandled exceptions in the finally block.
    What am I doing wrong here? If I have to put yet another try block inside of the finally block...doesn't that defeat the whole purpose of the finally block?You should also check myInput and myOutput references to make sure they are not null. If your first exception occurs during instantiation of your FileReader, for example, then myInput and myInput will both be null, causing a NullPointerException when you attempt to close them. Better to do something like:
    finally
      if ( myInput != null )
        myInput.close();
      if ( myOutput != null )
        myOutput .close();
    }� {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to block a material that not to creation of service notification thru-IW51

    Hi All,
    I have tried in all over areas ( MM02 level and MM06 level ) to block a material that not to create service notification with that material but didn't get a solution.If any one knows solution for this kindly provide me.
    "How to block a material that not to create a service notifcation thru IW51?"
    Best Regards,
    Narendra Konnipati

    Narendra,
    1. I do not see any possibility without using this exit. It is a very simple and effective thing for your ABAPer and you too.
    2. In case of many Materials-Notification type combinations, you can maintain similar code by joining several elseif s.
    3. Alternatively, you can maintain a Z Table as under:
    QMART
    MATNR
    S3
    10000000099999
    S3
    10000000099988
    S1
    10000000088988
    S2
    12000000088988
    Means, for every Notification type there will be one or more prohibited materials. The coding will not be difficult, but will have around 15/20 lines.Finally, if you have to get your issue resolved, I feel this is the way and also easy way through your ABAPer.
    Tell me in case of any further opinions.
    Best of Luck
    KJogeswaraRao

  • How to block changes in purchase order after purchase release

    Dear all
    Can u please tell us how to block any changes in purchase order after purchase order is released...
    (We don't want any line items addition or quantity addition or any changes once purchase order is released..)We wanted this for a particular purchase order type only
    Regards
    Sudha

    Dear Sudha
    Yes it is possible to confiquire your system insuch a way where once if the PO  gets final relase then it cannot be changed.Only possiblity that will be available for the user to make chanegs in PO is possible when the final release is to be reset and then make the changes.
    Release Indicator: specicfies whether the PO documents is blocked or can be processed for the follow functions.
    You can define the release indicators you need for your release procedure:
    •The Released indicator is used to specify whether messages (PO documents in output format) may be transmitted for a purchase order with this indicator.
    •The Changeability indicator shows the effect of changes to the PO (a change to a PO may require a new release strategy to be determined, for instance).
    •By means of the Value change indicator, you can specify that the release strategy is to be re-started if a PO is changed and the value of a PO item thereby increases by a certain percentage (e.g. 10%). Set the Changeability indicator to "4 - Changeable, new release in case of new strategy or value change" or "6 - Changeable, new release in case of new strategy or value change/outputted" and enter a percentage in the Value change field.
    And after that you can specify release statuese where you can specify which release indicator/status a PO is to have after having been released via a certain release code.
    and after release simulation .
    Test for the PO change after final release System will not allow you tomake changes by giving the message that the release  indicator doesnot allow you make the changes in PO.
    Regards
    Sunny

  • How to block MacKeeper and other browser ads

    how to
    block MacKeeper and other browser ads

    There is no need to download anything to solve this problem. You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • Exception: Given final block not properly padded

    Hi,
    I generated an password encrypted RSA private key using the following openssl command.
    openssl pkcs8 -topk8 -in private.pem -outform DER -out private.der -v2 des3
    I am using the following piece of code to decrypt private.der using a password entered by the user.
    For now, I assume that the password is of 24 bytes long.
    1. The following method throws an exception saying "Given final block not properly padded."
    How can I fix it?
    2. Since private.der is created by openssl, I didn't provide salt and iv paramters.
    Are they embedded in the file itself?
    Does the objects in the following method takes care of them automatically?
    Thanks.
    public byte[] readDES3EncryptedPrivateKey2(final String password,
                                                final String privateKeyFilePath)
    throws Exception
            File privateKeyFile = new File(privateKeyFilePath);
            byte[] encryptedPrivateKey = FileUtils.readFileToByteArray(privateKeyFile);
            final byte[] passwordInBytes = password.getBytes("UTF-8");
            DESedeKeySpec keySpec = new DESedeKeySpec(passwordInBytes);
            SecretKey key = SecretKeyFactory.getInstance(DES3).generateSecret(keySpec);
            javax.crypto.EncryptedPrivateKeyInfo epki = new javax.crypto.EncryptedPrivateKeyInfo(
                    encryptedPrivateKey);
            AlgorithmParameters ap = epki.getAlgParameters();
            des3Cipher.init(Cipher.DECRYPT_MODE, key, ap);
            // Error: Given final block not properly padded
            return des3Cipher.doFinal(epki.getEncryptedData());
        }

    I've run into similar things. Have you tried padding the data you are trying decrypt to the block size of DES3?

  • Given final block not properly padded

    I am working on an application that sends encrypted data over the network using Blowfish. I developed a simple server and client to test and I getting this error when I try to decrypt the cypher in the server. Here is what I do:
    This happens on the client side:
    I encrypt my message with this method
    public byte[] encryptedMessage() throws Exception{
            KeyGenerator keyGenerator = KeyGenerator.getInstance("Blowfish");
            keyGenerator.init(128);     
            Key key = keyGenerator.generateKey();
            Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
            cipher.init(Cipher.ENCRYPT_MODE, key);
            byte[] plaintext = getMessage().getBytes("UTF8");
            byte[] ciphertext = cipher.doFinal(plaintext);
            return ciphertext;
        }Then send it to the server like this:
    //get my cypher from the method shown before
    cipher = mc.encryptedMessage();
    //put the cypher in this simple object          
    InformationShared cipherToSend = new InformationShared(cipher.length);
    cipherToSend.setMessage(cipher);
    //Send it accross through the network
    Socket socket =  new Socket("127.0.0.1",8085);
    ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
    out.writeObject(cipherToSend);This is what happens in the server side:
    //Get the incoming object
    ObjectInputStream in = new ObjectInputStream( incoming.getInputStream() );
    //downcast the object
    InformationShared cipherIn = (InformationShared)in.readObject();
    //decypher the message  in the decypher method             
    String result = decypher(cipherIn.getMessage());
    //This is the decipher method
    public String decypher(byte cipherIn[]) throws Exception{
               KeyGenerator keyGenerator = KeyGenerator.getInstance("Blowfish");
               keyGenerator.init(128);     // need to initialize with the keysize
               Key key = keyGenerator.generateKey();
               Cipher ciph = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
               ciph.init(Cipher.DECRYPT_MODE, key);
               // Perform the decryption
               byte[] decryptedText = ciph.doFinal(cipherIn);
               String output = new String(decryptedText,"UTF8");;
               return output;
            }The error happens in the decypher method in this line:
    byte[] decryptedText = ciph.doFinal(cipherIn);Thanks for any help!

    Hi
    I am woriking on an web application that send Encrypted data over the network and stores into the databse.After that I want to retrieve that data from database then I want decrypt it by using DES.
    After Encryting It is storing properly into the database but while retriving from database and want to decrypt it the It is giving exception like "javax.crypto.BadPaddingException: Given final block not properly padded"
    For Encryption I am using one bean class tha are
    package EncryptBean;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.spec.*;
    import com.sun.crypto.provider.*;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.Cipher;
    import java.security.NoSuchAlgorithmException;
    import java.security.InvalidKeyException;
    import java.security.InvalidAlgorithmParameterException;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import sun.misc.BASE64Encoder;
    import sun.misc.BASE64Decoder;
    import javax.crypto.*;
    public class DesEncrypterBean {
    Cipher ecipher;
    Cipher dcipher;
    public DesEncrypterBean(SecretKey key) {
    try {
    ecipher = Cipher.getInstance("DES");
    dcipher = Cipher.getInstance("DES");
    ecipher.init(Cipher.ENCRYPT_MODE, key);
    dcipher.init(Cipher.DECRYPT_MODE, key);
    } catch(javax.crypto.NoSuchPaddingException e)
         {System.out.println("NoSuchPaddingException : "+e);     
                } catch (java.security.NoSuchAlgorithmException e)
    {System.out.println("NoSuchAlgorithmException : "+e);     
                } catch (java.security.InvalidKeyException e)
    {System.out.println("InvalidKeyException : "+e); }
    public String encrypt(String str) {
    try {
    // Encode the string into bytes using utf-8
    byte[] utf8 = str.getBytes("UTF8");
    // Encrypt
    byte[] enc = ecipher.doFinal(utf8);
    // Encode bytes to base64 to get a string
    return new sun.misc.BASE64Encoder().encode(enc);
    } catch (javax.crypto.BadPaddingException e) {
    System.out.println("encrypt BadPaddingException : "+e);
    } catch (IllegalBlockSizeException e) {
    System.out.println(" encrypt IllegalBlockSizeException : "+e);
    } catch (UnsupportedEncodingException e) {
    System.out.println("encrypt UnsupportedEncodingException : "+e);
    } catch (java.io.IOException e) {
    System.out.println("encrypt IOException : "+e);
    } return null;
    public String decrypt(String str) {
    try {
    // Decode base64 to get bytes
    // byte[] utf8 = str.getBytes("UTF8");
    byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);
    // Decrypt
    byte[] utf8 = dcipher.doFinal(dec);
    // Decode using utf-8
    return new String(utf8, "UTF8");
    } catch (javax.crypto.BadPaddingException e)
         {System.out.println("encrypt BadPaddingException : "+e);
                } catch (IllegalBlockSizeException e) {
    System.out.println("encrypt IllegalBlockSizeException : "+e);
    } catch (UnsupportedEncodingException e) {
    System.out.println("encrypt UnsupportedEncodingException : "+e);
    }catch (java.io.IOException e) {
    System.out.println("encrypt IOException : "+e);
    return null;
    ** By using bellow screen I am retrieving the data from screen and encrypting it and sended to the database I is working properly
    import EncryptBean.DesEncrypterBean;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.spec.*;
    import com.sun.crypto.provider.*;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.Cipher;
    import java.security.NoSuchAlgorithmException;
    import java.security.InvalidKeyException;
    import java.security.InvalidAlgorithmParameterException;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import sun.misc.BASE64Encoder;
    import javax.crypto.*;
    public class Secure_Encrypt extends HttpServlet
              Connection con=null;
              Statement stmt=null;
              Cipher ecipher;
    Cipher dcipher;
              String uname=null,pwd=null;
              ServletOutputStream sos;
              SecretKey key=null;
    public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException,IOException
    uname=req.getParameter("username");               pwd=req.getParameter("password");
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:GMT","sa","iqm");
    stmt=con.createStatement();
    sos=res.getOutputStream();
    // Generate a temporary key. In practice, you would save this key.
    // See also e464 Encrypting with DES Using a Pass Phrase.
    key = KeyGenerator.getInstance("DES").generateKey();
    // Create encrypter/decrypter class
    DesEncrypterBean encrypter = new DesEncrypterBean(key);
    // Encrypt
    String encrypted = encrypter.encrypt(uname);
    System.out.println("Don't tell anybody! "+encrypted);
    stmt.execute("insert into Admin(UserName,Passward) values('"+encrypted+"','"+encrypted+"')");
    System.out.println("......record saved");
    sos.println("Record Saved : "+encrypted);
    catch(Exception e)
    {System.out.println("Exception in login" +e);}
    In above Programe Woking Properly
    ** Bellow programe using for retrieving data from database.After retrieving data I want Decrypt it but not working properly
    import EncryptBean.DesEncrypterBean;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.spec.*;
    import com.sun.crypto.provider.*;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.Cipher;
    import java.security.NoSuchAlgorithmException;
    import java.security.InvalidKeyException;
    import java.security.InvalidAlgorithmParameterException;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import sun.misc.BASE64Encoder;
    import javax.crypto.*;
    public class Secure extends HttpServlet
              Connection con=null;
              Statement stmt=null;
              Cipher ecipher;
    Cipher dcipher;
              String uname=null,pwd=null;
              ServletOutputStream sos;
              SecretKey key=null;
    public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException,IOException
    try
    {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:GMT","sa","iqm");
    stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery("select UserName,Passward from Admin");
    while(rs.next())
         uname=rs.getString(1);
         pwd=rs.getString(2);
    sos=res.getOutputStream();
    // Generate a temporary key. In practice, you would save this key.
    // See also e464 Encrypting with DES Using a Pass Phrase.
    key = KeyGenerator.getInstance("DES").generateKey();
    // Create encrypter/decrypter class
    DesEncrypterBean encrypter = new DesEncrypterBean(key);
    // Decrypt
    uname=uname.trim();
    String decrypted = encrypter.decrypt(uname);
    System.out.println("Original message is! "+decrypted);
    }catch(Exception e)
    {System.out.println("Exception in login" +e);
    In above Programe giving Exception " javax.crypto.BadPaddingException: Given final block not properly padded"
    Please analyze my application and send me suitable solution for decryption
    one more thing When I encrypting that time KeyGenerator generating one key.same as when I Decrypting that time also KeyGenerator generating one key but both are not same.
    How can we generate both key are same

  • "Given final block not properly padded" when using wrong secretKey

    Hello guys, I browsed the questions in this forum regarding my problem, but somehow couldn't find a solution to this.
    I generated two SecretKey key1 and key2. Now I'm using the Cipher class to encrypt a message to key1. If I try to decrypt it with key1, everything works fine. But if I try key2 I get the "Given final block not properly padded"-message in my exception backtrace instead of just unreadable stuff, which I excepted (using the wrong key). This happens regardless of the symetric algorithm I use.
    Can you help me?
    Thanks,
    Sebastian

    Most symmetric algorithms work on data of a given block-size. If your data isn't a multiple of that size, it's padded. This removes a clue that a cryptanalyst can use to try and break your encryption. At decrypt time, the Cipher expects to see padding-related bits at the end of the stream, so it knows how many pad-bits were stuck on to begin with. When the end of the stream doesn't match the expected padding-protocol, you get the exception noted.
    Now - if you decode with the wrong key, you get junk. The chances of that junk ending with a valid padding-indicator is...small. So you're more likely to see "BadPadding" than a valid (if incorrect) plaintext.
    You could use "NoPadding" on both ends, and do your own manipulation of the bit-stream to make the Cipher happy. Then, you wouldn't get BadPadding exceptions. But you'd have to write some pretty fiddly code on each end.
    Anybody else want to double-check me on this? I'm away from my books at the moment. Floersh? Euxx?
    Good luck,
    Grant

  • How to Block favicon safari 7.1

    How to Block favicon safari 7.1

    Sorry I don't think it's reasonable to expect Apple cater to every single need. Should there be a preference for disabling gifs, pngs or jpegs how about an option for disabling gifs that are blue but only on Mondays when it's raining? There are too many possibilities to cater for everyone and there are other browsers that already work how you desire.
    OS X used to have preferences for different Dock styles, but Apple have been removing those options for sometime now. Your final sentence make it clear you already understand how Apple progresses. I have been on the receiving end of Apple's arbitrary changes too, but there came a point where I just got over it & found alternatives.
    'defaults write' settings played havoc with users updating to 10.9 - some users had disabled screenshot shadows, that resulted in System Preferences that had sections of UI totally missing, it took weeks to unpick the reason for the fault! These edge case 'hidden settings' can be more trouble than you imagine. They conflict in new & interesting ways with every update.
    You can ask Apple to revert the change, but it doesn't seem like something they would do. There is a simple way to evaluate possible feature requests - Ask yourself 'How does this benefit Apple?'
    http://apple.com/feedback/
    I tested the 'ugly hack' & it worked for me but an extension is the correct way to resolve it. Another option is to setup a proxy server that blocks them from downloading on any device on the network. Ultimately if you don't want to investigate a solution you are part of the problem.

Maybe you are looking for

  • How do I use my iPhone 4s to set GPS co-ordinates to use at a later date?

    I'm wanting to go to an aread in the bush - enter the GPS co-ordinates in my iPhone 4s and then be able to go back to the same place at a later date. How do I go about it.  I have no idea if I even have a GPS on my iPhone 4s.

  • All day events not appearing on iMac,Iphone or web. But does for iPad!

    I have a subscription to 'iTunes on sale' - link below. It lists iTunes vouchers that are on sale over a period of days. I can see the entries, or all day events, on my iPad calendar, but not on my iMac, iPhone or me.com calendar! http://www.google.c

  • How to see all image file types when saving images without selecting "all files"

    Hallo, and thank you fom reading. I am a person who saves a lot of images online in different folders with different names like G - 456 or F - 35. I have been using firefox 10.0.2 for a long time because of a bug (I guess) that made it easier to save

  • How to find the workflow admins for all costcenters ?

    Dear SRM gurus We are using Classic scenario with N th step workflow with BADI. we have a requirement. How to find the workflow admins for the particular costcenters. we used HRV1222A where ATTRIB EQ <Z attribute>(This is our own attribute to group a

  • ADD PAYR-ZNME1 to FBL3N Display

    Hi Everybody, I've been asked to add CHECF and ZNME1 from PAYR table into FBL3N , The 1st one is in the Special Field options but the 2nd one is not there. Is there an option to add this field into the Special Field Selection. or should I go to make