Firewall problem when encrypting/decryting a file

Hi,
I'm a little bit new to cryptography.
When I encrypt a file using the javax.crypto classes, my firewall pops up and says "java.exe is attempting to connect to a DNS Server".
If I block the firewall, nothing else happens and the file gets encrypted as well. But I don't want to insecure all my customers having this firewall alerts.
Can anyone help me to stop that ? Thanks in advance,
- fridi -
This is the example code I am using:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.GeneralSecurityException;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
public class TestCrypt {
     public static void main(String[] args) throws Exception, GeneralSecurityException {
          String inFilename = args[0];
          String outFilename = args[1];
          byte[] keyArray = "My one and only key blablabalbal".getBytes();
          DESedeKeySpec desedeKeySpec = new DESedeKeySpec(keyArray);
          SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede");
          SecretKey key = keyFactory.generateSecret(desedeKeySpec);
          Cipher cip = Cipher.getInstance("DESede");
          cip.init(Cipher.ENCRYPT_MODE, key);
          FileInputStream fis = new FileInputStream(inFilename);
          CipherInputStream cis = new CipherInputStream(fis, cip);
          FileOutputStream fos = new FileOutputStream(outFilename);
          byte[] b = new byte[1024];
          int i = cis.read(b);
          while (i != -1) {
               fos.write(b, 0, i);
               i = cis.read(b);
          fos.close();
          cis.close();          
}

What version of Windows are you using, and what kind of security-related software are you running on the PC? Have you tried executing your code on a Linux/UNIX machine? It is highly unlikely that you'll see the problem on that platform - but if you do, there are tools where you can trace the execution of the JVM and filter it for name-service API calls to see where it is being initiated from.
I would still bet that some software on your PC is causing the outbound call.

Similar Messages

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • Problem when I upload txt files to the server

    Hi, I have a problem when I try to upload files to the server, and I can't understand the fail.
    My case is:
    I have a jsp page where a from is.
    This form is sended to a servlet that proccess its content and upload the attach file to the server.
    It works correctly (it uploads the files, txt, xls and csv), the problem is when I try to upload a txt file like this, for example:
    Depth     Age
    0     0,1
    2     0,9
    3     2
    5     6
    6     9
    8     12
    34     25
    56     39
    101     40When I verify the uploaded file, this one has a character extra of return of line (a small square). This character prevents me from working then correctly with the file, on having detected a column of more.
    Which can be the problem?
    The code I use to uploaded the file is:
    try
        MyConnection Objconnection = new MyConnection();
        boolean isMultipart = FileUpload.isMultipartContent(req);
        // Create a factory for disk-based file items
        FileItemFactory factory = new DiskFileItemFactory();
         // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        // Set overall request size constraint
        upload.setSizeMax(1024*512); //524288 Bytes (512 KB)
         // Parse the request
        List items = upload.parseRequest(req);
        // Process the uploaded items
        Iterator iter = items.iterator();
        String dat = new String();
        String typeFile = new String();
        while (iter.hasNext())
            FileItem item = (FileItem) iter.next();
            if (item.getFieldName().equals("typeFile") )
                typeFile = item.getString();
            if (!item.isFormField())
            String fieldName = item.getFieldName();
            String fileName = item.getName();
            String contentType = item.getContentType();
            boolean isInMemory = item.isInMemory();
            long sizeInBytes = item.getSize();
            int numbers=0;
            for(int i=fileName.length();(i=fileName.lastIndexOf('\\',i-1))>=0;)
                 numbers++;
            String stringFile[] = fileName.split("\\\\");
            HttpSession session = req.getSession(true);
            String loginSesion = (String)session.getAttribute("UserLogin");
            String newUserFolder = loginSesion;
            File createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder);
            if ("AgeModel".equals(typeFile))
                createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder);
            if (!createFile.exists())
                createFile.mkdir();
            fileName = stringFile[numbers];
            File uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder+"/"+fileName);
            if ("AgeModel".equals(typeFile) )
                uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder+"/"+fileName);
            existe = Objconnection.existFile(fileName, typeFile, loginSesion);
            if ( true == existe )
                 exito = false;
            else
                item.write(uploadedFile);
                ....// NOW REGISTER THE FILE IN TH DATA BASE
        } // if (!item.isFormField())
    } // WHILE ( iter.hasNext() )
                catch(Exception e) {
                out.println("Error de Aplicaci�n " + e.getMessage());
                return exito;
    ...THANKS

    Hi,
    Sorry I am aware this question was posted way back, but I am having similar problem and haven't been able to find the fix yet.
    So please let me known if you have got any ideas.
    My problem is same that I have to upload a CSV file from Client Machine (Windows) to Unix Application Server.
    I am using JSP method post and multipart/form-data (as in http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml).
    The file is uploaded fine but the problem is it displays carraige Return (^M) a square boxes on Unix file.
    I can't ask user to convert file to Unox format before uploading. They just convert excel file to CSV and upload.
    Is there any way I can get rid of these characters as I have to use this file further.
    Sorry, I can't use any paid utility or tool for it.
    I would appreciate if you could please help.
    Thanks,
    SW

  • Problem when uploading a large file in PI - weird SQL I/O errors

    Hi guys,
    I'm facing a very difficult problem when uploading a 35 MB with an FTPs adapter. I see in the logs that, after the translation to XML, it's going to 170 MB.
    I receive the following error in the CC Monitoring:
    Error: com.sap.aii.af.ra.ms.api.DeliveryException: Problem inserting 41827ca7-6b8c-4a87-198d-ad8a81fcb12b(OUTBOUND) into the database: com.sap.engine.services.dbpool.exceptions.BaseSQLException: Connection is invalid.
    When I look in the NWA Monitoring, I see the following details:
    SQL error occurred on connection affhb201:X11:SAPSR3DB: code=17,002, state="null", message="Io exception: Socket closed";
    SQL statement is "INSERT INTO "XI_AF_MSG" ("MSG_ID","DIRECTION","MSG_BYTES","TIMES_FAILED","SENT_RECV_TIME","STATUS","CONN_NAME","MSG_TYPE","REF_TO_MSG_ID","ADDRESS","TRANSPORT","CREDENTIAL","TRAN_HEADER","MSG_PROFILE","CONVERSATION_ID","SCHEDULE_TIME","PERSIST_UNTIL","FROM_P........
    I cannot check the Visual Admin Logs 'cause I don't have access to them yet.
    I'm pretty convinced that some swap memory, message size or whatever setting on the adapter engine or on the Java stack is preventing this. I do not get any message in CC Monitoring when uploading a smaller, 6 MB version of the same file.
    Can you please help me solve this or give me some interesting pointers?
    Never before did we experience something like this in the PI system. In addition, I didn't find any useful resource on the SDN and throughout the SAP notes for this.
    Let me know if you need more info about this.
    Best regards,
    George

    Hi George
    I am facing the same issue, where did you configure the message split in the Communication Channel?
    If I do the message split as you said, is it going to create several files or how does it work?
    Thanks in advanced
    Emmanuel

  • Problem when load more swf files work with xml files into my movie

    hi ;
    I have one flash file & more of swf files which work with xml files .
    when I load one swf file into my flash file  and remove it and load anther one on the same movieclip in my flash file it load the old swf file.
    when i load one on movieclip and remove it and load anther swf  on anther movieclip the file doesn`t work  and stoped.
    when test my flash file to load and remove swf files without xml file it work fine but when repleaced the swf files with other work with xml files the problem hapend.
    thanks;

    YOu should trace the names of the files that are being targeted for loading to see if they agree with what you expect.  If you want help with the coding you will need to show the code that is relevant to your problem (not all of it)

  • Aperture 3: problem when re-processing raw files to the latest converter

    After converting to Aperture 3, many of my Nikon D80 raw files are coming up with the message:
    "This photo was adjusted using an earlier version of Apple's RAW processing."
    Aperture 3 offers a "Reprocess" button next to the message. Every time I click it, the images gets messed up with a big spike in the highlight end of the green channel. Is this a bug? Anyone else seeing this?

    I faced the same problem when importing from my card reader. I chose to save the A3 library on a removable disk. The importing took ages to finish, and then all the pictures had a green color. It said that the pictures were processed using an earlier Apple Raw processor, and I had the Reprocess button. I did that and nothing changed.
    I restarted A3, and now my project has disappeared even though it is available on disk.
    I opened the original library on my MB hard disk and the photos showed fine.
    I'm going to retest this, by importing the pictures to the default A3 library, maybe it will then recognize my pictures and process them correctly.
    EDIT: when importing to the default Aperture Library (not the one on a separate drive), it's very fast, correct, and no problems. I'll guess I'll have to backup the old way...
    Message was edited by: ninofrewat

  • Permissions with problem when encrypting pdf with certificate

    I am using the following javascript code to encrypt a pdf using a certificate:
                        var thePermissions = {
                             allowAll: false,
                             allowAccessibility: false,
                             allowContentExtraction: false,
                             allowChanges: "none",
                             allowPrinting: "none"
                         var theCertificate = security.importFromFile(
                             "Certificate",
                             "/c/user.cer"
                         var theUserEntity = {
                             firstName: "The",
                             lastName: "User",
                             fullName: "The User",
                             certificates: theCertificate,
                             defaultEncryptCert: theCertificate
                         var theGroup = { userEntities: [ theUserEntity ], permissions: thePermissions };
                         encryptForRecipients( { oGroups: [ theGroup ] } );
                        saveAs("encrypted.pdf");
    The file "encrypted.pdf" resulting is in fact encrypted, but the permissions doesn't seem to be correct. For instance, the Document Properties show that there are no document restrictions (DocumentProperties.PNG), but when the details are shown, it seems that the correct restrictions apply (DocumentSecurity.PNG). As can be seen in the permissions variable, there should be no permissions to the pdf generated. Can someone possibly help me with this?
    Additional info: there should have no human interaction in the process, the certificate is not fixed (preventing using encryptUsingPolicy), and will be selected based on the file name of the original pdf.

    Hi Leonard,
    I see the same thing executing the script from the JavaScript console. There is a slight wrinkle in the steps to reproduce. Even if everything worked as it's supposed to, you would still need to close and then reopen the file in order to get the perm restrictions to take effect. This is because when you initially encrypt the file you are still the document owner, and thus none of the perms have yet taken effect. However, once you do close and then reopen the file (thus forcing an authentication), the file should open with the perms being enforced, but alas, they are not.
    Interestingly, if you go into the Document Properties and then select the Security tab (or just click the Permissions Details button in the DMB) you see that the Restriction Summary shows that everything is allowed, but when you click the Show Details button, which just displays the restrictions applicable to the encryption handler, it shows the correct settings. Of course the real bug isn't that the restriction summary is incorrect, but rather that it is correct and all of the supposedly restricted operations are allowable.
    I'll enter this as a bug against 10 along with the ER to add the encryption algorithm as an option to the encryptForRecipients JS function.
    Steve

  • Problem when chenging a word file into PDF

    when I convert a word file into a PDF one, the whole font of the file changes. I use in the original document arial 12, when I convert the file the size and font of the whole file changes, what can I do to avoid that to happen??? IT'S URGENT I use microsoft word 2010

    Hi astridlenina,
    How well a file converts depends largely on the quality of the original file.
    Would you send your PDF document to [email protected] as an email attachment? 
    I will check it from my end.Please add the link to this forum post for reference.
    Regards,
    Florence

  • Problems when I eliminate the files in ucm

    Hi, good morning.
    When I eliminate a file of ucm the URL of the file does not disappear, if I realise a content search remains the URL of the file although this already she has been eliminated, as I can avoid this.

    Hello.
    Yes, I am waiting for the indexer cycle, the URL is the Link that adds ucm to be able to visualize the file as well as its information, I eliminate the content and this if it is eliminated but URL follows there, if I give click in sends a message to me that says the action cannot be realised so that is not the file.

  • SetHeader problem when user downloads a file from a server

    Hi everyone,
    I have a question about the way to let a user download a file. A created a jsp that handles the download. This is the code:
    <%@ page import="java.io.*" %><%
        response.setHeader("Content-Disposition", "attachment; filename=" + session.getAttribute("executedCommand").toString());
        response.setContentType("text/csv");
        int iRead;
        FileInputStream stream = null;
        try {
            File f = new File(session.getAttribute("executedCommand").toString());
            stream = new FileInputStream(f);
            while ((iRead = stream.read()) != -1) {
                out.write(iRead);
            out.flush();
        }finally {
            if (stream != null) {
                stream.close();
    %>When I run this, I get a download window, so that the right file can be downloaded, but I would like the application to show me the name of that file in the download window and in my save dialog, and that's something I haven't managed to do yet, because I always get the name of the servlet (that redirects to the jsp page). So the problem is, the right file is downloaded but it's name is never shown in the download window. How can I resolve that?
    Thanks for your help!
    E_J

    I forgot to say that my session variable contains the absolute path of the file the user can download. Maybe using session variables is not the best solution in this case, but it should have to work, shouldn't it?
    Still waiting for some help. I really appreciate it...
    E_J

  • Problem when printing a PDF file

    I am currently using Pagemaker 7 and after I create a PDF file and then email it to my client, the image shrinks when they print it out on their printer. If I print that same PDF file on my printer it does not shrink. Can anyone explain why this happens and how I can correct this problem? Would be must appreciated.

    Screen captures are a good way to show people how to set page scaling to none
    Jay

  • There are some strange problems when i used swc files in my as3 project

    Hello everyone,
            My development environment:  fdk4.0,  flash cs5.5,  I publish fla file by using flash cs5.5,   publish setting is  fp version :10.0&10.1 ->swc. I imported swc files to my as3 project and  complied them by using flex sdk4.0. When i run my project,fp was crash.   when i republished on fp 10.2, the project works. Is there any reason?
            another strange problem, for example   a MovieClip's aslink named "A" in swc, it has a textfield named "subText".  I write code like below:
                            var mc:A = new A();
                            mc.subText.text = "test";  
             when mc called "subText" , fp throws null property error, it can't find  subText..  very small number of movieclips have this problem,  I sloved this by duplicating a new one and rename it.
             but i don't  know why ? 
              thank you for your reply.

    I should have figured that out from your original post. I think there is a possibility that your bookmarks/history database (places.sqlite) has a corrupted record. Rather than take drastic action on that immediately, could you do a test? The test is to exit Firefox, rename your existing database, and restart Firefox. Firefox should import your last bookmarks backup. You then could check whether the problem remains or whether you got a clean restore of bookmarks. After the test, assuming you prefer to retain your history, you could undo the procedure and try restoring your bookmark backup into the database to see whether that overwrites the problem record. If not, then we would go back to possible drastic action.
    '''Test procedure''':
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > "Show Folder" button
    Switch back to Firefox and Exit
    Pause while Firefox finishes its cleanup, then rename '''places.sqlite''' to something like places_20130614.sqlite. Keep this window open.
    Restart Firefox. By design, Firefox should import your last automatic bookmark backup.
    If you return to the Library dialog, how does it look?
    '''To reverse the test''' (but preserve a backup of your history/bookmark database):
    Exit Firefox
    Delete the newly created places.sqlite file
    Right-click copy and paste the places_20130614.sqlite and rename the copy to places.sqlite
    Restart Firefox and open the Library dialog. Should look like it did a few minutes ago before any changes.
    ''If the test showed no corruption,'' try to restore your last bookmarks backup. The procedure is described in this article: [[Restore bookmarks from backup or move them to another computer]].
    Does any of that get us closer to a solution?

  • CS6 Color Channel Problem When Saving Oil Paint Files

    When I save an OIL PAINT file created in Photoshop CS6, it saves with red and blue shapes over the image. Before saving, the image looks fine. I'm running windows 8. Is it me or a CS6 bug?

    There were some driver problems that caused single tile artifacts when running Oil Paint.
    Have you updated your video card driver from the GPU maker's website?

  • Problem when downloading the JAR file

    I'm just install JRE and testing my first applet application. I'm facing the problem that I can not download the JAR file from my localhost computer.
    I've enable cache in Java Control Panel and running my applet. Normally, it will download the jar file from my localhost and save it to the cache directory of Java. And then finding all classes neccessary to run my applet in the JAR file.
    But I discover that I can not download the JAR file and save to my computer. I try to put the URL to download this JAR file (http://localhost/myjar.jar) in my web address, it start to download this file properly. But when open it with WINRAR, I got an error that the file "Unexpected end of file".
    I try to put this file from onther computer in my LAN. And use the URL to download it. This time I can open the JAR file with WINRAR althrought the file size is the same
    Anyone know why there are some errors when download from my localhost? Thanks in advance for any help!!!

    Yeah everything matches up!
    Could it have something to do with the string encoding? I created the file in ANSI format? Would this have an effect on it?

  • Problem when trying to move files with NSFileManager

    Hi there folks.
    I am trying to use some very simple code here to move a folder into another folder on my (or a user's) computer. I have used this code before, but can't for the life of me pinpoint the issue here.
    This is the code that I am using:
    NSString *fromParent = [@"~/Desktop/Images" stringByExpandingTildeInPath];
    NSString *toParent = [openPanel filename]; //this is the result of the user's selection in an NSOpenPanel
    [[NSFileManager defaultManager] moveItemAtPath:fromParent toPath:toParent error:&error];
    When I look at the Console, the error returned from the attempted move is this;
    "Error = Error Domain=NSCocoaErrorDomain Code=512 UserInfo=0x15e65500 "“Images” could not be moved to “rickyd”"
    I'll also add that there is not an issue with the folders/files I am using, as I have also tried numerous other folders/files.
    Although I understand this information is pretty brief, I'd really appreciate and help you guys could lend me here.
    Thanks in advance,
    Ricky.

    Yes, you're correct. The toPath needs to not yet exist.
    I forgot I had to specify the complete file path of the directory after the move would have occurred.
    E.g - instead of having ~/Documents, I need to have ~/Documents/Images.
    Thanks for your little hint
    Ricky.

Maybe you are looking for

  • Database Clone

    Hello - I am running Oracle 8.1.7.4 on Solaris. I am attempting to clone a database on the same server. For example, use online backups of db1 and recover as db2 on the same server. I need to recover using the backup controlfile because I have to rec

  • Cannot type shift-i

    i cannot type the capitol i.  Also the computer is making clicking noises from the speakers and responding very slowly.  At times, it acts like the return key is being held down.  What gives? John sys 10.5.8, Macbook Pro A1211

  • Main in inbox and sent folder gone after recreating mail account in prefs

    I called my ISP when I was getting outgoing mail server error messages. Their tech person said that I had to recreate that email account. They had me delete the existing account then basically make the account again. Expletives deleted. The result fo

  • Giving my phone to my GF

    I recently gave my old phone to my GF. Reset All Dta and went through set up on her laptop. Still wants to access my I Tunes Account for apps etc. She doesnt have internet contract yet but can get by Wi-Fi on local network. How Can I get Her apple Id

  • Lightroom catalog and activity on different hard drive

    New to Lr.  I have downloaded the 30-day trial and the process is so automated that I doesn't provide an opportunity to install on a drive other than the boot drive (C:\) . I have a very small solid state drive that I use only for my OS and other key