Packets not getting encrypt and decrypt IPSEC

Hi Everyone,
I have 2691 Router conencted to Internet and it is doing Nat.
This connects to 3550A  Switch which has connection to 1811W  Router.
I setup VPN between 1811W and 3550A.
3550A has connection to 2691 via ospf.
OSPF is running between 1811w and 3550A.
1811
1811w# sh crypto isakmp sa
IPv4 Crypto ISAKMP SA
dst             src             state          conn-id status
192.168.99.2    192.168.99.1    QM_IDLE           2005 ACTIVE
IPv6 Crypto ISAKMP SA
1811w# sh crypto ipsec sa
interface: FastEthernet0
    Crypto map tag: VPN_MAP, local addr 192.168.99.1
   protected vrf: (none)
   local  ident (addr/mask/prot/port): (192.168.0.0/255.255.0.0/0/0)
   remote ident (addr/mask/prot/port): (192.168.99.0/255.255.255.0/0/0)
   current_peer 192.168.99.2 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
    #pkts decaps: 0, #pkts decrypt: 0, #pkts verify: 0
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 30, #recv errors 0
     local crypto endpt.: 192.168.99.1, remote crypto endpt.: 192.168.99.2
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0x0(0)
     PFS (Y/N): N, DH group: none
     inbound esp sas:
     inbound ah sas:
     inbound pcp sas:
     outbound esp sas:
     outbound ah sas:
     outbound pcp sas:
3550A
3550SMIA#                                                                                           sh crypto isakmp sa
IPv4 Crypto ISAKMP SA
dst             src             state          conn-id slot status
192.168.99.2    192.168.99.1    QM_IDLE           1001 ACTIVE
IPv6 Crypto ISAKMP SA
3550SMIA#sh cry
3550SMIA#sh crypto ipsec sa
interface: FastEthernet0/8
    Crypto map tag: VPN_MAP, local addr 192.168.99.2
   protected vrf: (none)
   local  ident (addr/mask/prot/port): (192.168.0.0/255.255.0.0/0/0)
   remote ident (addr/mask/prot/port): (192.168.99.0/255.255.255.0/0/0)
   current_peer 192.168.99.1 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
    #pkts decaps: 0, #pkts decrypt: 0, #pkts verify: 0
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 15, #recv errors 0
     local crypto endpt.: 192.168.99.2, remote crypto endpt.: 192.168.99.1
     path mtu 1500, ip mtu 1500
     current outbound spi: 0x0(0)
     inbound esp sas:
     inbound ah sas:
     inbound pcp sas:
     outbound esp sas:
As seen above the packets are not encrypted between 1811w and 3550A.
I have used same ACL  on both 1811W and 3550A
ip access-list extended INTERESTING_TRAFFIC
permit ip 192.168.0.0 0.0.255.255 192.168.99.0 0.0.0.255 log
Any reasons why packets are not getting encrypt and decrypt?
Thanks
MAhesh

Hi Eugene,
I did that here is info now
        sh crypto ipsec sa
interface: FastEthernet0
    Crypto map tag: VPN_MAP, local addr 192.168.99.1
   protected vrf: (none)
   local  ident (addr/mask/prot/port): (192.168.0.0/255.255.0.0/0/0)
   remote ident (addr/mask/prot/port): (192.168.99.0/255.255.255.0/0/0)
   current_peer 192.168.99.2 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 43, #pkts encrypt: 43, #pkts digest: 43
    #pkts decaps: 43, #pkts decrypt: 43, #pkts verify: 43
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 1, #recv errors 0
     local crypto endpt.: 192.168.99.1, remote crypto endpt.: 192.168.99.2
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0x8319FE5B(2199518811)
     PFS (Y/N): N, DH group: none
     inbound esp sas:
      spi: 0xAE0A578B(2919913355)
        transform: esp-des esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 15, flow_id: Onboard VPN:15, sibling_flags 80000046, crypto map: VPN_MAP
        sa timing: remaining key lifetime (k/sec): (4454255/2388)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE
     inbound ah sas:
     inbound pcp sas:
     outbound esp sas:
      spi: 0x8319FE5B(2199518811)
        transform: esp-des esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 16, flow_id: Onboard VPN:16, sibling_flags 80000046, crypto map: VPN_MAP
        sa timing: remaining key lifetime (k/sec): (4454255/2388)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE
     outbound ah sas:
     outbound pcp sas:
Seems it is encrypted now.
Congig of ACL
ip access-list extended INTERESTING_TRAFFIC
permit ip 192.168.0.0 0.0.255.255 192.168.99.0 0.0.0.255 log
even though i have log command config in thr ACL  still it shows only
2 logs
.Dec 15 14:23:55.723 MST: %SEC-6-IPACCESSLOGP: list INTERESTING_TRAFFIC permitted udp 192.168.99.1(123) -> 192.168.99.2(123), 1 packet
.Dec 15 14:29:28.391 MST: %SYS-5-CONFIG_I: Configured from console by mintoo on vty0 (192.168.98.6)
.Dec 15 14:40:55.749 MST: %SEC-6-IPACCESSLOGP: list INTERESTING_TRAFFIC permitted udp 192.168.99.1(123) -> 192.168.99.2(123), 1 packet
1811w#
Do you know why is this?
Thanks
MAhesh

Similar Messages

  • AES encrypt and decrypt not the same

    I use aes to encrypt and decrypt a file. Why is the resulting file not the same as the input?
    package mybeans;
    import java.io.*;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Hashtable;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class Encrypt {
         public static void main(String args[]) throws Exception {
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec keySpec = new SecretKeySpec(
                        "05468345670abcde".getBytes(), "AES");
              IvParameterSpec ivSpec = new IvParameterSpec("f45gt7g83sd56210"
                        .getBytes());
              cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
              FileInputStream fis = new FileInputStream(new File("C:\\text.txt"));
              CipherInputStream cis = new CipherInputStream(fis, cipher);
              FileOutputStream fos = new FileOutputStream(new File(
                        "C:\\encrypted.txt"));
              byte[] b = new byte[8];
              int i;
              while ((i = cis.read(b)) != -1) {
                   fos.write(b, 0, i);
              fos.flush();
              fos.close();
    package mybeans;
    import java.io.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class Decrypt {
         public static void main(String args[]) throws Exception {
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec keySpec = new SecretKeySpec(
                        "05468345670abcde".getBytes(), "AES");
              IvParameterSpec ivSpec = new IvParameterSpec("f45gt7g83sd56210"
                        .getBytes());
              cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
              FileInputStream fis = new FileInputStream(new File("C:\\encrypted.txt"));
              CipherInputStream cis = new CipherInputStream(fis, cipher);
              FileOutputStream fos = new FileOutputStream(new File(
                        "C:\\decrypted.txt"));
              byte[] b = new byte[8];
              int i;
              while ((i = cis.read(b)) != -1) {
                   fos.write(b, 0, i);
              fos.flush();
              fos.close();
              cis.close();
              fis.close();
    }Here is the data in the file:
    James,"smith",007
    mike,"smith",001
    the result is this:
    James,"smith",007
    mike,"smith",
    Edited by: iketurna on Jun 3, 2008 1:47 PM

    Thanks sabre!
    Very insightful.
    I used PKCS5Padding and the file has all of the data, but there are extra padding at the end of the second line
    Also,
    how would you store your key and iv?
    Currently I using this to create the iv and key:
    public class KeyClass {
    private SecretKeySpec keygeneration() {
    SecretKeySpec skeySpec=null;
    try {
      KeyGenerator kgen = KeyGenerator.getInstance("AES");
      kgen.init(128);
      SecretKey skey = kgen.generateKey();
      byte[] key = skey.getEncoded();
      skeySpec = new SecretKeySpec(key,"AES");
    }catch(Exception e) {
      System.out.println("error in keygen = "+e);
    return skeySpec;
    public void keyFile() {
    try{
    FileOutputStream fos=new FileOutputStream("c:\\keyFile.txt");
    DataOutputStream dos=new DataOutputStream(fos);
    SecretKeySpec skeySpec=keygeneration();
    byte[] key=skeySpec.getEncoded();
    BASE64Encoder base64 = new BASE64Encoder();
    String encodedString = base64.encodeBuffer(key);
    dos.write(encodedString.getBytes());
    }catch(Exception e1){
      System.out.println("error file write "+e1);
    public static void main(String args[]){
      KeyClass cKey = new KeyClass();
      cKey.keyFile();
    }Edited by: iketurna on Jun 5, 2008 7:29 AM

  • Question regarding encryption and decryption

    Hi all,
    I am doing a authentication project. In which I do encryption and decryption (AES 128 bit) in two different methods. At the time of encryption (for eg a text file ), I store the key in dat file (key.dat). And at the time of decryption, I read the key.dat and extract the key and do the decryption. This works fine. No problem with that.
    But the problem is, that the client requires that
    "No encryption keys will be written to the hard drive."
    I have to store the key somewhere to decrypt the encrypted file. Right. Without storing the key, I cannot decrypt.
    The question is (though its a foolish question) with out storing the key, can i encrypt and decrypt (in two different methods) the text file ?
    Thank You.
    Regards,
    Jay

    Hi Grant,
    Thanks for the reply. ( I am the one whom you helped to solve the encryption and decryption problem using AES )
    I will give you an overview of my project. Its an Two Factor Authentication using an USB Flash Drive.
    Admin Side : ( currently developing this part )
    Through an CPP executable file ( writen by John Hyde USB By Example author), I retrive the Manufature ID, Product ID and Serial number of the USB Flash Drive from a text file which is generated when the executable file is executed.
    From my Java application, i retrive the Manufature ID, Product ID and Serial number.The admin (through an dialog box ) enters an usernam and password . All this information ( Manufature ID, Product ID, Serial number , username and password ) using AES 128 bit encryption i write these information to encrypted file in the USB Flash drive along with the the encryption key used at the time of decryption.
    User Side: ( not yet devleoped )
    When the user plugs in the USB Flash drive, an dialog box is shown where the user enters the username and password ( assigned earlier by the admin). This username and password is checked along with the Manufature ID, Product ID and Serial number encrypted earlier and stored in the USB Flash drive. If username password ,Manufature ID, Product ID and Serial number (retrieved again by exectuing the CPP excutable file ) are correct the user is granted access.
    Whats your suggestion reagrading of storing the encryption key? I have to store the key in the USB Flash drive along with the encrypted file. But then wont an intruder (for eg ) if he gets the key and decrypt the file ?
    Client has mentioned to use AES 128 Bit encryption.
    Thank You.
    Regards,
    Jay.

  • Urgent - encrypt and decrypt the single field (String)

    Hi,
    I want to create Java program which can encrypt and decrypt the single field (String). Can you please pass me the code. I am new to the Java and my technical background is not from Java. Appreciate your speedy response.
    You can directly reach me at [email protected]
    --Akshay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Welcome to the Developer Community! We'd like you to get the most out of your experience at the Forums. Please keep in mind that the many of the developers who help you are working for a living, and all of them are providing you with free advice. It is only fair for you to do some homework first prior to posting. Here are some suggestions from the developer community to the newest members. To avoid wasting fellow members' time unnecesarily, please use the following checklist before posting a question:
    * Search before Posting: Especially if you are in a hurry, you may find that the question has already been asked and answered during the long history of the Forums.
    * Know the basics: Read this FAQ and the basic trails of the Java Tutorial (like Getting Started or Learning the Java Language). If you don't understand the question you are posing, you may not understand the answers.
    * Be thorough and precise: Proofread your question before posting. Describe the steps that you have taken. The more effort you put into researching and describing your problem, the more likely you will get a sincere effort in return.
    * Post a subject line that describes the problem: Experts in your subject may skim right past subject lines like "Urgent" and "Need help ASAP". Use keywords about the technologies instead.
    * Post a problem, not an assignment: Break your assignment down into specific problems that you can ask for help with. Dorm hall lounges may be a better resource if you have a last minute, "urgent" demand for solutions to homework problems.
    -- From the [Java Forums FAQ|http://developers.sun.com/resources/forumsFAQ.html#Getting]

  • The Encrypt and Decrypt functions.

    All,
    I need to use the Encrypt and Decrypt functions for our password filed in a table.
    The procedures need to pass in an input_string (string to be en/decrypted) and a key_string (en/decryption key string). What is the key_string? Where can I get it from? or How can I generate it?
    Could someone please give some examples on how to use those functions?
    Thanks in advance!

    This may help you, works with 8.1.7 upwards :
    We used this approach when I worked on a project in Holland. We encrypted customers' names and addresses. Note : the value to be encrypted had to be a multiple of 8 characters in length so we always rpad'd values upto a multiple of 8 say 32 and rtrim'd following decryption. W were using 8.1.7. at the time and I am unsure if this requirement still exists. Note : the encryption key was actually held in a package which was wrapped and in a schema with password only known to few.
    set serverout on size 1000000
    declare
       input_string_c     varchar2(16) := '1234567812345678'; -- must be multiple of 8 bytes long
       key_string_c       varchar2(57) := 'abcdefghijklmnop'; -- the key needs to be at leat 8 bytes long
       encrypted_string_c varchar2(2048);
       decrypted_string_c varchar2(2048);
    begin
       dbms_obfuscation_toolkit.desencrypt (input_string     => input_string_c,
                                            key_string       => key_string_c,
                                            encrypted_string => encrypted_string_c) ;
       dbms_obfuscation_toolkit.desdecrypt (input_string     => encrypted_string_c,
                                         key_string       =>  key_string_c,
                                   decrypted_string => decrypted_string_c);
       dbms_output.put_line('encrypted string = >'||encrypted_string_c||'<');
       dbms_output.put_line('decrypted string = >'||decrypted_string_c||'<');
    end;
    /HTH
    AMM

  • Problem in using socket streams with encryption and decryption

    Hi,
    I am developing a client/server program with encryption and decryption at both end. While sending a message from client it should be encrypted and at the receiving end(server) it should be decrypted and vice versa.
    But while doing so i got a problem if i use both encryption and decryption at both ends. But If i use only encryption at one (only outputstream) and decryption at other end(only inputstream) there is no problem.
    Here is client/server pair of programs in which i am encrypting the outputstream of the socket in client side and decrypting the inputstream of the socket in server side.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         public static void main(String args[])
              try
              {                    //server listening on port 2000
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        //Input starts from here
                        Reader in=new InputStreamReader(getNetInStream(theConnection.getInputStream()),"ASCII");
                        StringBuffer strbuf=new StringBuffer();
                        int c;
                        while (true)
                             c=in.read();
                             if(c=='\n' || c==-1)
                                  break;
                             strbuf.append((char)c);     
                        String str=strbuf.toString();
                        System.out.println("Message from Client : "+str);
                        in.close();               
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static BufferedInputStream getNetInStream(InputStream in) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataDec = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecDec = new DESKeySpec(desKeyDataDec);
              SecretKeyFactory keyFactoryDec = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyDec = keyFactoryDec.generateSecret(desKeySpecDec);
              // use Data Encryption Standard
              Cipher desDec = Cipher.getInstance("DES");
              desDec.init(Cipher.DECRYPT_MODE, desKeyDec);
              CipherInputStream cin = new CipherInputStream(in, desDec);
              BufferedInputStream bin=new BufferedInputStream(new GZIPInputStream(cin));
              return bin;
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         public static void main(String args[])
              try
                   Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   //Output starts from here               
                   OutputStream out=getNetOutStream(theConnection.getOutputStream());
                   out.write("Please Welcome me\n".getBytes());
                   out.flush();
                   out.close();
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static OutputStream getNetOutStream(OutputStream out) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataEnc = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecEnc = new DESKeySpec(desKeyDataEnc);
              SecretKeyFactory keyFactoryEnc = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyEnc = keyFactoryEnc.generateSecret(desKeySpecEnc);
              // use Data Encryption Standard
              Cipher desEnc = Cipher.getInstance("DES");
              desEnc.init(Cipher.ENCRYPT_MODE, desKeyEnc);
              CipherOutputStream cout = new CipherOutputStream(out, desEnc);
              OutputStream outstream=new BufferedOutputStream(new GZIPOutputStream(cout));
              return outstream;
    Here is client/server pair in which i use both encrypting outpustream and decrypting inputstream at both ends.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         private Cipher desEnc,desDec;
         serverSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec = Cipher.getInstance("DES");
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        final Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        Thread input=new Thread()
                             public void run()
                                  try
                                       //Input starts from here
                                       Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");
                                       StringBuffer strbuf=new StringBuffer();
                                       int c;
                                       while (true)
                                            c=in.read();
                                            if(c=='\n'|| c==-1)
                                                 break;
                                            strbuf.append((char)c);     
                                       String str=strbuf.toString();
                                       System.out.println("Message from Client : "+str);
                                  catch(Exception e)
                                       System.out.println("Error caught inside input Thread : "+e);
                        input.start();
                        Thread output=new Thread()
                             public void run()
                                  try
                                       //Output starts from here
                                       OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                       System.out.println("it will not be printed");
                                       out.write("You are Welcome\n".getBytes());
                                       out.flush();
                                  catch(Exception e)
                                       System.out.println("Error caught inside output Thread : "+e);
                        output.start();
                        try
                             output.join();
                             input.join();
                        catch(Exception e)
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              serverSocketDemo server=new serverSocketDemo();          
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         private Cipher desEnc,desDec;
         clientSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desDec = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   final Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   Thread output=new Thread()
                        public void run()
                             try
                                  //Output starts from here               
                                  OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                  out.write("Please Welcome me\n".getBytes());
                                  out.flush();
                             catch(Exception e)
                                  System.out.println("Error caught inside output thread : "+e);
                   output.start();     
                   Thread input=new Thread()
                        public void run()
                             try
                                  //Input starts from here
                                  Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");          
                                  System.out.println("it will not be printed");
                                  StringBuffer strbuf=new StringBuffer();
                                  int c;
                                  while (true)
                                       c=in.read();
                                       if(c=='\n' || c==-1)
                                            break;
                                       strbuf.append((char)c);     
                                  String str=strbuf.toString();
                                  System.out.println("Message from Server : "+str);
                             catch(Exception e)
                                  System.out.println("Error caught inside input Thread : "+e);
                   input.start();
                   try
                        output.join();
                        input.join();
                   catch(Exception e)
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              clientSocketDemo client=new clientSocketDemo();     
    **** I know that the CInput tries to read some header stuff thats why i used two threads for input and output.
    Waiting for the reply.
    Thank you.

    Do not ever post your code unless requested to. It is very annoying.
    Try testing what key is being used. Just to test this out, build a copy of your program and loop the input and outputs together. Have them print the data stream onto the screen or a text file. Compare the 1st Output and the 2nd Output and the 1st Input with the 2nd Input and then do a static test of the chipher with sample data (same data which was outputted), then do another cipher test with the ciphertext created by the first test.
    Everything should match - if it does not then follow the steps below.
    Case 1: IO Loops do not match
    Case 2: IO Loops match, but ciphertext 1st run does not match loop
    Case 3: IO Loops match, 1st ciphertext 1st run matches, but 2nd run does not
    Case 4: IO Loops match, both chiphertext runs do not match anything
    Case 5: Ciphertext runs do not match eachother when decrypted correctly (outside of the test program)
    Problems associated with the cases above:
    Case 1: Private Key is changing on either side (likely the sender - output channel)
    Case 2: Public Key is changing on either side (likely the sender - output channel)
    Case 3: Private Key changed on receiver - input channel
    Case 4: PKI failure, causing private key and public key mismatch only after a good combination was used
    Case 5: Same as Case 4

  • Are there any tools for data encryption and decryption ?

    Hi,
    i am using oracle 9i R2, i want encrypt my data. Are there any tools available in market.
    Please let me know the ways to do data encryption and decryption.
    Thanks in advance
    Prasuna.

    970489 wrote:
    using DBMS_OBFUSCATION_TOOLKIT.Encrypt /DESEncrypt we can't secure our password...So i am looking for an another alternative.As Blue Shadow said, what are you really trying to achieve?
    Encrypting a password is itself not secure. Anything that can be encrypted can be decrypted. That is why Oracle itself DOES NOT encrypt passwords.
    Surprised??
    Here's what Oracle does with passwords, and what others should be doing if they have to store them.
    When the password is created, the presented password - clear text - is concatenated with the username. The resulting character string is then passed through a one-way hashing function. It is that hashed value that is stored. Then when a user presents his credentials to log on to the system, the presented credentials are combined and hashed in the same manner as when the password was created, and the resulting hash value compared to the stored value.

  • Encrypt and decrypt using dbms_crypto.hash

    hi to all i am newbie here and i've just want to ask if how can i decrypt the encryted password.
    v_pass_string = 'qwerty';
    lower(dbms_crypto.hash(to_clob(v_pass_string),3))
    The out is: b1b3773a05c0ed0176787a4f1574ff0075f7521e
    and i want to output it into original data which is *'qwerty'*
    please help...
    thanks in advance

    You can't.
    HASH is not an encryption algorithm, it is a one-way hashing algorithm. HASHed cannot be converted back to the original value. This is one reason they are used for passwords as they offer the best security.
    If you want to encrypt and decrypt values you would use the ENCRYPT and DECRYPT functions of the DBMS_CRYPTO package...
    http://www.psoug.org/reference/dbms_crypto.html

  • Encrypting and Decrypting Data(Its Very Urgent, Please Help.)

    Hi,
    Can anyone tell me some idea in the below mentioned details.
    Iam creating a Function for Encrypting and Decrypting Data Values using
    DBMS_OBFUSCATION_TOOLKIT with UTL_RAW.CAST_TO_RAW by using
    Key Value as normal.
    But the problem, is it possible to have the key value more than 8.
    Its showing me error when i give the key value less than 8 or more than 8.
    Can u tell me why it happens, is that the limit of the key value or is any other way to do that.
    Its Very Urgent, Please Help.
    Thanks,
    Murali.V

    Is this what you're looking for?
    Usage Notes
    If the input data or key given to the DES3DECRYPT procedure is empty, then the procedure raises the error ORA-28231 "Invalid input to Obfuscation toolkit."
    If the input data given to the DES3DECRYPT procedure is not a multiple of 8 bytes, the procedure raises the error ORA-28232 "Invalid input size for Obfuscation toolkit." ORA-28233 is NOT applicable for the DES3DECRYPT function.
    If the key length is missing or is less than 8 bytes, then the procedure raises the error ORA-28234 "Key length too short." Note that if larger keys are used, extra bytes are ignored. So a 9-byte key will not generate an exception.
    C.

  • How do I protect my FLV files? or How to encrypt and decrypt FLV files using AIR?

    Hi,
         I am working on an AIR application, which is developed on eLearning concept. The application mainly deals with flv files. The application contains a video player component, which will stream flv files from an Apache Server and played in my application. Here my concern is I would like to protect my flv files some how against users who may stream them from Apache Server and use them without my application.
         I thought of with an idea to do it. But I don't know whether it will work or not. So I am requesting for your suggestions and better ways to do this with a sample.
    Here is my thought:
    I would like to place the encrypted FLV files at Apache Server side [ Need to know how to encrpt the FLV files using Flex]
    As my AIR application send a request for a FLV file, the Apache server should send the decryption key and a stream of FLV file.
    AIR application should take the decryption key, stream of flv file and it should capable enough to decrypt the FLV file and play it in my application. [ But I don't know how to encrypt/decrypt FLV files through flex]
    I can do encryption of FLV files using Mac Address of Apache Server system and using Java. But I don't know how can I decrypt the same FLV file ( Encrypted using Mac Address and java ) at AIR application side.
    So I would be greatfull If any body help me in encrypting and decrypting of FLV file with a sample using Flex 3.0.
    Thanks
    Sudheer Puppala

    russellfromblackburn south wrote:
    Is it because the portable drive is NTFS format and the Mac wont recognise this? If so what do I do?
    Yes, this is exactly what is causing the problem. Macs cannot write to NTFS formatted drives, only read. You must move the documents to the internal HDD/SSD of the Mac to be able to edit them.
    Or, since you say you don't want to move the documents to the internal storage, you'll need to format the external HDD as FAT32.

  • Issue regarding Planning layout is not getting rendered and is dumping at : CL_RSDRC_TREX_QUERY_LAYER ~ _GET_PARTPROVS_WITH_TREX_PART in SAP TPM IP

    Gurus,
    I am facing an issue regarding SAP TPM IP ( HANA)
    I have 3 Infoproviders
    Planning infocube, Planning DSO1, Planning DSO2 and i created multiprovider and added these 3 infoproviders into it. I have created Aggregation level on multiprovider. Created Bex Input ready query on Aggregation level.
    Issue is  Planning layout is not getting rendered and is dumping at : CL_RSDRC_TREX_QUERY_LAYER ~ _GET_PARTPROVS_WITH_TREX_PART.
    I tried debugging it and found it is trying to read   i_r_pro -> n_ts_part. It is populated with only 3 values (i.e. 2DSOs and 1 Cube), whereas <l_partprov>-partprov is referring to Aggergation level, hence read statement isn't successful, it is dumping.
    The class CL_RSD_INFOPROV_CACHE->GET() method is trying to populate the N_TS_PART.N_TS_PART uses P_R_INFOPROV table which seems to be already populated.  So, I debugged all the below methods to find out how the P_R_INFOPROV but couldn't find any clue.
    Can any one help,it would be really help.
    Thanks
    Ashok

    Hello Gregor,
    On the launch of planning layout it throws an error message:
    Planning is not possible RSCRM_IMP_CORE008.
    When I debugged, i got to a point wherein
    particular Real Time Planning DSO is
    not getting retrieved under the MultiProivder in below class.
    Class: CL_RSCRM_IMP_ACTIONS_SERVICE, Method: GET_INFOPROV is not
    returning the real time Info-Provider Name(i.e. Planning DSO)
    underlyingthe Multiprovider.
    I've also tried to run the report mentioned by you for the Multiprovider but issue still exists.
    Let me know, if you have any pointers on this topic.
    Thanks,
    Jomy

  • HR iViews are not getting displayed and showing "Page can not be found".

    Hello,
    I am facing an issue in the EP 7 wherein all the standard HR iViews are not getting displayed and showing "Page can not be found".
    We have added S_SERVICE autorisation object to user used for the relative JCO as well by looking at other similar forums but that did not help.
    I have attached last part of log from file application.log under "F:\usr\sap\EP1\JC01\j2ee\cluster\server0\log"
    #0002A537D2A6006A0000027300001C4C00046E3590936E5F#1247076244733#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Administrator#12374##n/a##b7291b106be911de8d8a0002a537d2a6#SAPEngine_Application_Thread[impl:3]_27##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    #1.5 #0002A537D2A6007A0000001200001C4C00046E35AAA74D33#1247076682222#/Applications/WebApplications##com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Guest#0##n/a##cf997d306af811dec69d0002a537d2a6#Thread[Finalizer,8,system]##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: destroy#
    #1.5 #0002A537D2A6005F0000026C00001C4C00046E35C2814813#1247077082383#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#SKhatkale#12460##n/a##a7cb51e06beb11de8bd70002a537d2a6#SAPEngine_Application_Thread[impl:3]_6##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    #1.5 #0002A537D2A60075000002BD00001C4C00046E35C3AD4359#1247077102039#/Applications/Xss#sap.com/tcwddispwda#com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent#SKhatkale#12464##rrisep1p01_EP1_14481150#SKhatkale#b6d348006beb11deb9780002a537d2a6#SAPEngine_Application_Thread[impl:3]_31##0#0#Fatal#1#com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent#Plain###You do not have the authorization to start service sap.com/pcui_gp~xssutils/XssMenu.#
    #1.5 #0002A537D2A6007A0000001300001C4C00046E35DDE07029#1247077541575#/Applications/WebApplications##com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Guest#0##n/a##cf997d306af811dec69d0002a537d2a6#Thread[Finalizer,8,system]##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: destroy#
    #1.5 #0002A537D2A600650000024600001C4C00046E36B6DBE4D0#1247081181950#/Applications/WebApplications#sap.com/irj#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Administrator#12873##n/a##37e186606bf511de8bf20002a537d2a6#SAPEngine_Application_Thread[impl:3]_0##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.runtime.context.ServletContextImpl#Plain###application [irj] prt: init#
    Please let me know if anybody has come across such scenario before.
    Thanks
    Suhas
    Edited by: Suhas Khatkale on Jul 8, 2009 10:09 PM

    Hi,
    This issue is now resolved. We followed up with SAP and they suggested to update the component EP-PSERV to latest patch which was earlier to patch 1. Later on we upgraded it to patch 4 and this resolved the issue.
    Thanks
    Suhas

  • I can not get iPhone and iPad calendar to sync.  Help

    Help. I can not get iPad and iPhone calendar to sync

    Please also check, if the appointments you already have entered on one device are stored in a iCloud calendar or only local or in another account. Therefor just open the calendar app, then open an existing appointment, click on "Calendar" and then check, if it is really an iCloud calendar where the appointment is stored.

  • I-pod touch is not getting sync and the error message is coming as "i-tunes couldn't connect to i-tunes store. An unknown error occurred (-3212).

    Hi
    My i-pod touch is not getting sync and the error message is coming as "i-tunes couldn't connect to i-tunes store. An unknown error occurred (-3212).
    I have updated the latest OS 6.0 in my i-pod touch.
    Kindly send the solution
    Regards
    Deepak
    <Email Edited By Host>

    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?
    Also, you are not addressing Apple here. We are all just users like yourself.

  • Credit note is not getting generate and there is no error log

    Hi,
    Could you please help with the following scenario.
    I have created a credit memo with reference to a billing document. Then  when I try and create a credit note for this credit memo, it does not get generated and the following message apprears 'No billing documents were generated'
    Processing status for this is - 'Not Processed'
    and there are no messages in the error log as well.
    Could you please advise as to what the missing configuration might be? As i can't seem to find what is causing the problem
    Your advise is much appreciate.
    Thanks & Regards,
    Amalie

    Kindly create a Credit Memo Request wrt to Billing Document by maintaining in the Copying Control through VTAF and then create a Credit Memo wrt Credit Memo request through VTFA.
    Then go to VOFA with your Billing Type and maintain Account Determination Procedure.
    it does not get generated and the following message apprears 'No billing documents were generated'
    Do you able to get the Number while saving the Credit Memo or not able to save it .
    Kindly check the configuration of Account ket in VKOA also .
    Best Regards,
    Ankur

Maybe you are looking for

  • Low quality when saving MMs pics

    I've been getting MMS pics of the kids from my wife's phone (not an iphone) for a while, and they look great on my iPhone 4 screen. The good ones I save to Photos. As of today, the new ones still look great on the screen, but when I save them the qua

  • Enabling ITS to a User Defined Transaction

    Hello, <i>I have Module pool program which generates user id and Password in SAP. But the requirement is that it should be ITS enabled. ( The users should be able to view it in the Interner Explorer instead of SAP )</i>I heard that we have a feature

  • Reservation feature in SharePoint 2013

    Hi, As We know "Group work List" feature is not available in SharePoint 2013.So can you help me how to add the double booking and overlapping functionality to the calender list in SharePoint 2013. Is it possible through the SharePoint out of box feat

  • Problem in test case

    Hi guys, we are using solution manager for testing.  We have created the test case with test case type "Test Document" in SOLAR02 transaction.  Here we are trying to attach our test script sothat it can be included in the test note generated by blue-

  • Can't delete some trash on MacBook Pro

    Tried several times including a reboot but about 200 small files are stuck in the trash.  Anyone have any ideas?  Yesterday I ran Disk Utility and fixed some permissions on hard drive but thinking maybe I should reinstall Lion.  Am going to try to do