Search Results

Search found 113 results on 5 pages for 'o vamsi krishna'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Exception - Illegal Block size during decryption(Android)

    - by Vamsi
    I am writing an application which encrypts and decrypts the user notes based on the user set password. i used the following algorithms for encryption/decryption 1. PBEWithSHA256And256BitAES-CBC-BC 2. PBEWithMD5And128BitAES-CBC-OpenSSL e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC); d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC); e_Cipher.init() d_Cipher.init() encryption is working well, but when trying to decrypt it gives Exception - Illegal Block size after encryption i am converting the cipherText to HEX and storing it in a sqlite database. i am retrieving correct values from the sqlite database during decyption but when calling d_Cipher.dofinal() it throws the Exception. I thought i missed to specify the padding and tried to check what are the other available cipher algorithms but i was unable to found. so request you to please give the some knowledge on what are the cipher algorithms and padding that are supported by Android? if the algorithm which i used can be used for padding, how should i specify the padding mechanism? I am pretty new to Encryption so tried a couple of algorithms which are available in BouncyCastle.java but unsuccessful. As requested here is the code public class CryptoHelper { private static final String TAG = "CryptoHelper"; //private static final String PBEWithSHA256And256BitAES = "PBEWithSHA256And256BitAES-CBC-BC"; //private static final String PBEWithSHA256And256BitAES = "PBEWithMD5And128BitAES-CBC-OpenSSL"; private static final String PBEWithSHA256And256BitAES = "PBEWithMD5And128BitAES-CBC-OpenSSLPBEWITHSHA1AND3-KEYTRIPLEDES-CB"; private static final String randomAlgorithm = "SHA1PRNG"; public static final int SALT_LENGTH = 8; public static final int SALT_GEN_ITER_COUNT = 20; private final static String HEX = "0123456789ABCDEF"; private Cipher e_Cipher; private Cipher d_Cipher; private SecretKey secretKey; private byte salt[]; public CryptoHelper(String password) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeySpecException { char[] cPassword = password.toCharArray(); PBEKeySpec pbeKeySpec = new PBEKeySpec(cPassword); PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, SALT_GEN_ITER_COUNT); SecretKeyFactory keyFac = SecretKeyFactory.getInstance(PBEWithSHA256And256BitAES); secretKey = keyFac.generateSecret(pbeKeySpec); SecureRandom saltGen = SecureRandom.getInstance(randomAlgorithm); this.salt = new byte[SALT_LENGTH]; saltGen.nextBytes(this.salt); e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES); d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES); e_Cipher.init(Cipher.ENCRYPT_MODE, secretKey, pbeParamSpec); d_Cipher.init(Cipher.DECRYPT_MODE, secretKey, pbeParamSpec); } public String encrypt(String cleartext) throws IllegalBlockSizeException, BadPaddingException { byte[] encrypted = e_Cipher.doFinal(cleartext.getBytes()); return convertByteArrayToHex(encrypted); } public String decrypt(String cipherString) throws IllegalBlockSizeException { byte[] plainText = decrypt(convertStringtobyte(cipherString)); return(new String(plainText)); } public byte[] decrypt(byte[] ciphertext) throws IllegalBlockSizeException { byte[] retVal = {(byte)0x00}; try { retVal = d_Cipher.doFinal(ciphertext); } catch (BadPaddingException e) { Log.e(TAG, e.toString()); } return retVal; } public String convertByteArrayToHex(byte[] buf) { if (buf == null) return ""; StringBuffer result = new StringBuffer(2*buf.length); for (int i = 0; i < buf.length; i++) { appendHex(result, buf[i]); } return result.toString(); } private static void appendHex(StringBuffer sb, byte b) { sb.append(HEX.charAt((b>>4)&0x0f)).append(HEX.charAt(b&0x0f)); } private static byte[] convertStringtobyte(String hexString) { int len = hexString.length()/2; byte[] result = new byte[len]; for (int i = 0; i < len; i++) { result[i] = Integer.valueOf(hexString.substring(2*i, 2*i+2), 16).byteValue(); } return result; } public byte[] getSalt() { return salt; } public SecretKey getSecretKey() { return secretKey; } public static SecretKey createSecretKey(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException { PBEKeySpec pbeKeySpec = new PBEKeySpec(password); SecretKeyFactory keyFac = SecretKeyFactory.getInstance(PBEWithSHA256And256BitAES); return keyFac.generateSecret(pbeKeySpec); } } I will call mCryptoHelper.decrypt(String str) then this results in Illegal block size exception My Env: Android 1.6 on Eclipse

    Read the article

  • NHibernate Criteria

    - by Vamsi
    public class A { public string aname {get; set;} public string aId {get; set;} public string bId {get; set;} } public class B { public string bId {get; set;} public string bname {get; set;} public string cId {get; set;} } public class C { public string cId {get; set;} public string cfirstname {get; set;} public string clastname {get; set;} } public class abcDTO { public string aname {get; set;} public string bname {get; set;} public string clastname {get; set;} } Evetually the query which I am looking is SELECT a.aid, b.bname, c.clastname FROM A thisa inner join B thisb on thisa.bid=thisb.bid inner join C thisc on thisb.cid=thisc.cid and this_.POLICY_SEARCH_NBR like '%-996654%' The criteria which I am trying is, Please let me know the best possible way to write a criteria so that I can get the abcdto object as result var policyInsuranceBusiness = DetachedCriteria.For() .SetProjection(Projections.Property("a.aid")) .Add(Restrictions.Like("a.aid", "1-SAP-3-996654", MatchMode.Anywhere)) .CreateCriteria("b.bid", "b", JoinType.InnerJoin) .SetProjection(Projections.Property("b.bname")) // ERROR OUT - COULD NOT RESOLVE PROPERTY .CreateCriteria("c.cid", "c", JoinType.InnerJoin) .SetProjection(Projections.Property("c.clastname")); // ERROR - COULD NOT RESOLVE PROPERTY IList plo = policyInsuranceBusiness.GetExecutableCriteria(_session).SetResultTransformer(NHibernate.Transform.Transformers .AliasToBean();

    Read the article

  • How to access a String Array location in android?

    - by Vamsi Challa
    Android 2.3.3 This is my code... String[] expression = {""}; //globally declared as empty somewhere in the code below, I am trying to assign a string to it. expression[0] = "Hi"; I keep getting the following error... 12-08 22:12:19.063: E/AndroidRuntime(405): java.lang.ArrayIndexOutOfBoundsException Can someone help me with this.. Can we access the index 0, directly as i am doing? Actual Code ::: static int x = 0; // global declaration String[] assembledArray = {""}; // global declaration assembleArray(strSubString, expression.charAt(i)); //Passing string to the method //Method Implementation private void assembleArray(String strSubString, char charAt) { // TODO Auto-generated method stub assembledArray[x] = strSubString; assembledArray[x+1] = String.valueOf(charAt); x = x+2; }

    Read the article

  • Where to start learning about audio or video codecs ?

    - by Vamsi
    Hi, I am very much confused to know what happens inside the codecs. I want to learn about the elements inside audio encoders and decoders. Would be very happy if you can provide me some links where i can find some good study material. Thanks precisely i would like to know how the codec parses the a media file.

    Read the article

  • Rails Application expecting me to restart my webrick server for any change in my controller.

    - by Vamsi
    I am working on an existing Rails 2.3.x application, So I was working on it and it was a messy code with great difficulty I was able to run the application. But now for every small change in one of my controller it is expecting me to restart my serer otherwise the changes are not reflecting back, Let's take an example scenario here, Let's just say in one of the before_filter method I just added a puts statement on top of the method and it was not printing in the log, after I restart the server it is printing, Can some one please let me know if I am missing something here.

    Read the article

  • Nginx ssl redirection of images

    - by krishna raj
    Hi. I am trying to set up nginx as reverse proxy for a tomcat server using SSL connection. I want the client's browser to load my tomcat application when nginx reverse proxy's IP is called from client's browser. My tomcat application's address is 192.168.25.25 and nginx proxy's address is 192.168.25.50 In my nginx.conf file i have added these lines # location / { proxy_pass https://192.168.25.25:443/myapp/; proxy_redirect https://192.168.25.25/myapp/ https://192.168.25.25/; } # Some of the images in my application is stored at 192.168.25.25/images/ . Now these directories cant be accessed as the proxy_pass is set to 192.168.25.25:443/myapp. Is there way to access images directory also without changing proxy_pass ? Thanks in advance.

    Read the article

  • ISSUE IN CONNECTING PRO9000 CAMERA WITH OMAP3530

    - by Vinay krishna
    I have a video phone application running on OMAP 3530 board.The problem is when i connect the camera(pro 9000) through a powered USB hub (Inp:100to240v, OUT:5v,1A) everything works fine when I make a video call.But If i connect the camera directly to the OMAP3530 board and try to make a video call,OMAP board is not sending any video packets captured locally.And also the PIP(Picture In Picture) is disabled.

    Read the article

  • Issue in connecting Pro9000 camera directly with OMAP3530

    - by Vinay krishna
    I have a video phone application running on an OMAP3530 board. The problem is when I connect the camera (Pro 9000) through a powered USB hub (In:100-240V, Out:5V,1A) everything works fine when I make a video call. But if I connect the camera directly to the OMAP3530 board and try to make a video call, the OMAP board is not sending any video packets captured locally. And also the PIP (Picture In Picture) is disabled.

    Read the article

  • How to rectify FDQN error in mirroring?

    - by krishna chaitanya
    While establishing mirroring without witness at last step i am getting an error: One or more of the server network addresses lacks a fully qualified domain name (FDQN). To start mirroring without using a FQDN, click "yes". To specify the FDQN, click "no". Then specify every TCP address by using the syntax for a fully qualified TCP address, and click Start mirroring again. TCP/IP are in enabled mode in Computer management. How to rectifity this error?

    Read the article

  • Standard PHP configuration command for centos 6.5

    - by Krishna
    First of all let me tell you my knowledge in managing server and configuring script is very basic. Now I am trying to setup a server for my personal use. My server is up and running in Centos 6.5 with PHP, MySql and ISPConfig. I felt that even PHP is installed it needs some configuration for a standard web server. I searched on and found some 'configure' command but none working. The reason they did not have a specific step by step guidance on how to do this. Can somebody help me to configure PHP in a standard way? Thanks in advance. Some more detail, as required - 1. I did not install PHP from source. 2. Yes, I want some standard modules to be enabled in PHP 3. I also want to know do I need to change some settings on default? I do have a managed VPS, so do you suggest me to copy php.ini from that VPS to new dedicated server so all required settings which is working fine for me to be copied here also? Thanks

    Read the article

  • Xmodmap configuration

    - by Krishna S
    On my Debian Linux machine Ctrl+Alt+F1 is bound to a virtual terminal. I can see the corresponding entry by running xmodmap -pke keycode 67 = F1 XF86_Switch_VT_1 F1 XF86_Switch_VT_1 Per this thread, which I might add is consistent with what I've read elsewhere, the columns on the right hand side of = correspond to key, Shift+key, AltGr+key and Shift+AltGr+key. Given that, I don't understand how the keycode mapping for F1 (above) works for Ctrl+Alt+F1. It seems it should really be either Shift+F1 or Shift+AltGr+F1? Here's the output of xmodmap -pm on my machine: shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x25) control Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) Can anybody explain it?

    Read the article

  • Success with E-Business Suite Release 12 Implementations: Intelligroup, Inc.

    Want to learn more about implementing Oracle E-Business Suite Release 12? Listen to this Srinivas Krishna, Sr. Intelligroup is a global provider of outsourcing services including application management and support services, infrastructure management services, innovative consulting, technology, and implementation services. Learn more at: http://www.intelligroup.com/Direction – Oracle Practice, Intelligroup, Inc discuss customer experiences and benefits from Release 12 implementations.

    Read the article

  • WPF Richtextbox XamlWriter behaviour

    - by Krishna
    I am trying to save some c# source code into the database. Basically I have a RichTextBox that users can type their code and save that to the database. When I copy and paste from the visual studio environment, I would like to preserve the formating etc. So I have chosen to save the FlowDocuments Xaml to the database and set this back to the RichTextBox.Document. My below two function serialise and deserialise the RTB's contents. private string GetXaml(FlowDocument document) { if (document == null) return String.Empty; else{ StringBuilder sb = new StringBuilder(); XmlWriter xw = XmlWriter.Create(sb); XamlDesignerSerializationManager sm = new XamlDesignerSerializationManager(xw); sm.XamlWriterMode = XamlWriterMode.Expression; XamlWriter.Save(document, sm ); return sb.ToString(); } } private FlowDocument GetFlowDocument(string xamlText) { var flowDocument = new FlowDocument(); if (xamlText != null) flowDocument = (FlowDocument)XamlReader.Parse(xamlText); // Set return value return flowDocument; } However when I try to serialise and deserialise the following code, I am noticing this incorrect(?) behaviour using System; public class TestCSScript : MarshalByRefObject { } Serialised XAML is using System; public class TestCSScript : MarshalByRefObject {}{ } Notice the the new set of "{}" What am I doing wrong here... Thanks in advance for the help!

    Read the article

  • qftp mput rawcommand

    - by krishna
    Hello, I have a doubt regarding multiple file transfer with qftp. There is no direct way to transfer multiple files with qftp class. Well, I tried it using arbitrary ftp command "mput" with "rawCommand" in QFTP. But it doesnt work for me. Please let me know how I could do a multiple file transfer with qftp. Thanks,

    Read the article

  • WSDL using soapclient

    - by Krishna Priya
    Hi, Need to access a webservice using soapclient.I have the following settings. ini_set('default_socket_timeout', 120); $client = new SoapClient( "http://example.com/OnlineOrderProcessingWS.asmx?WSDL", array('proxy_host' = "proxy url", 'proxy_port' = proxy port ) ); $param=array("varname1"='value1',"varname2"='value2'); $result = $client-CustomerOrder($param); print_r($result); Executing this script throwing Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers. How to fix this issue. Please anyone help.

    Read the article

  • Issue while loading a dll library file... java.lang.UnsatisfiedLinkError: Can't load library

    - by Bhaskara Krishna Mohan Potam
    Hi, While loading a dll file, I am getting the following exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: D:\Transliteration\rlpnc-3.1.0-sdk-ia32-w32-msvc80\rlp\bin\ia32-w32-msvc80\btutiljni.dll at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at com.basistech.util.internal.Native.bootstrapUtilitiesJNI(Unknown Source) at com.basistech.util.internal.Native.loadLibrary(Unknown Source) at com.basistech.rnt.jni.(Unknown Source) at com.basistech.rnt.RNTEnvironment.(Unknown Source) at SampleTranslator.(TranslateNameSample.java:88) at TranslateNameSample.main(TranslateNameSample.java:62) not sure about the root cause of the issue. Can anybody help me out in resolving this issue. Thanks, Bhaskar

    Read the article

  • Netbeans Profile JUnit 4 problem

    - by Krishna K
    I have a unit test that takes 200 sec to run. I am trying to use NetBeans profiler to speed it up. But the profiler doesn't run the unit test. It just creates an object of the test and exits. Doesn't run the actual test methods or @Before / @After methods. This is a maven project with surefire and junit 4. And partial output is below. Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 9) Profiler Agent: Established local connection with the tool ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.cris.puzzle.solvers.SudokuSolverTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 Profiler Agent: Connection with agent closed Profiler Agent: Connection with agent closed Profiler Agent: Initializing... Profiler Agent: Options: >C:/Program Files/NetBeans 6.8/profiler3/lib,5140,10< Profiler Agent: Initialized succesfully ------------------------------------------------------------------------ BUILD SUCCESSFUL ------------------------------------------------------------------------ Total time: 14 seconds Does anyone know how to make it work? Thank you.

    Read the article

  • diophantine equation

    - by krishna chaitanya
    Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n" in python

    Read the article

  • Nested URLs and Rewrite rules in Apache2

    - by Radha Krishna. S.
    Hi, I need some help with rewrite rules and nested URLs. I am using TikiWiki for my website and am in the process of setting up SE friendly URLs for my projects. Specifically, I have the following rewrite rule for www.example.com/projects to point to a page that lists out all the projects hosted in example. RewriteRule ^Projects$ articles?type=Project [L] This works fine. Now, I would like to point www.example.com/projects/project1 to point to a specific project. I have this rewrite rule RewriteRule ^(Projects/Project1)$ tiki-read_article.php?articleId=6 This works, but partially. The content is all rendered as text but the theme - images/ css etc all go for a toss - the page is completely in text. I understand that this happens 'cause the relative paths in the theme/ css/ images all refer to Projects as the base folder instead of the root of the website. I don't want to touch the CMS portion - change the theme/ css/ image paths in the files, more for reasons of upgradability. Can someone help me understand and write a rule so that the above nested URL works? Regards, Radha

    Read the article

  • Strange behaviour of code inside TransactionScope?

    - by Krishna
    We are facing a very complex issue in our production application. We have a WCF method which creates a complex Entity in the database with all its relation. public void InsertEntity(Entity entity) { using(TransactionScope scope = new TransactionScope()) { EntityDao.Create(entity); } } EntityDao.Create(entity) method is very complex and has huge pieces of logic. During the entire process of creation it creates several child entities and also have several queries to database. During the entire WCF request of entity creation usually Connection is maintained in a ThreadStatic variable and reused by the DAOs. Although some of the queries in DAO described in step 2 uses a new connection and closes it after use. Overall we have seen that the above process behaviour is erratic. Some of the queries in the inner DAO does not even return actual data from the database? The same query when run to the actaul data store gives correct result. What can be possible reason of this behaviour?

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >