Search Results

Search found 455 results on 19 pages for 'lee olayvar'.

Page 9/19 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Java error: Bad version number in .class file error when trying to run Cassandra on OS X

    - by Sam Lee
    I am trying to get Cassandra to work on OS X. When I run bin/cassandra, I get the following error: ~/apache-cassandra-incubating-0.4.1-src > bin/cassandra -f Listening for transport dt_socket at address: 8888 Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:675) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:316) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) From what I could determine by searching, this error is related to incompatible versions of Java. However, as far as I can tell, I have the latest version of Java: ~/apache-cassandra-incubating-0.4.1-src > java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211) Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode) ~/apache-cassandra-incubating-0.4.1-src > javac -version javac 1.6.0_13 ~/Downloads/apache-cassandra-incubating-0.4.1-src > echo $JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home Any ideas on what I'm doing wrong?

    Read the article

  • Where to Store the Protection Trial Info for Software Protection Purpose

    - by Peter Lee
    It might be duplicate with other questions, but I swear that I googled a lot and search at StackOverflow.com a lot, and I cannot find the answer to my question: In a C#.Net application, where to store the protection trial info, such as Expiration Date, Number of Used Times? I understand that, all kinds of Software Protection strategies can be cracked by a sophiscated hacker (because they can almost always get around the expiration checking step). But what I'm now going to do is just to protect it in a reasonable manner that a "common"/"advanced" user cannot screw it up. OK, in order to proof that I have googled and searched a lot at StackOverflow.com, I'm listing all the possible strategies I got: 1. Registry Entry First, some users might not have the access to even read the Registry table. Second, if we put the Protection Trial Info in a Registry Entry, the user can always find it out where it is by comparing the differences before and after the software installation. They can just simply change it. OK, you might say that we should encrypt the Protection Trial Info, yes we can do that. But what if the user just change their system date before installing? OK, you might say that we should also put a last-used date, if something is wrong, the last-used date could work as a protection guide. But what if the user just uninstall the software and delete all Registry Entries related to this software, and then reinstall the software? I have no idea on how to deal with this. Please help. A Plain File First, there are some places to put the plain file: 2.a) a simple XML file under software installation path 2.b) configuration file Again, the user can just uninstall the software and remove these plain file(s), and reinstall the software. - The Software Itself If we put the protection trial info (Expiration Date, we cannot put Number of Used Times) in the software itself, it is still susceptible to the cases I mentioned above. Furthermore, it's not even cool to do so. - A Trial Product-Key It works like a licensing process, that is, we put the Trial info into an RSA-signed string. However, it requires too many steps for a user to have a try of using the software (they might lose patience): 4.a) The user downloads the software; 4.b) The user sends an email to request a Trial Product-Key by providing user name (or email) or hardware info; 4.c) The server receives the request, RSA-signs it and send back to the user; 4.d) The user can now use it under the condition of (Expiration Date & Number of Used Times). Now, the server has a record of the user's username or hardware info, so the user will be rejected to request a second trial. Is it legal to collection hardware info? In a word, the user has to do one more extra step (request a Trial Product Key) just for having a try of using the software, which is not cool (thinking myself as a user). NOTE: This question is not about the Licensing, instead, it's about where to store the TRIAL info. After the trial expires, the user should ask for a license (CD-Key/Product-Key). I'm going to use RSA signature (bound to User Hardware)

    Read the article

  • python MySQLdb got invalid syntax when trying to INSERT INTO table

    - by Michelle Jun Lee
    ## COMMENT OUT below just for reference "" cursor.execute (""" CREATE TABLE yellowpages ( business_id BIGINT(20) NOT NULL AUTO_INCREMENT, categories_name VARCHAR(255), business_name VARCHAR(500) NOT NULL, business_address1 VARCHAR(500), business_city VARCHAR(255), business_state VARCHAR(255), business_zipcode VARCHAR(255), phone_number1 VARCHAR(255), website1 VARCHAR(1000), website2 VARCHAR(1000), created_date datetime, modified_date datetime, PRIMARY KEY(business_id) ) """) "" ## TOP COMMENT OUT (just for reference) ## code website1g = "http://www.triman.com" business_nameg = "Triman Sales Inc" business_address1g = "510 E Airline Way" business_cityg = "Gardena" business_stateg = "CA" business_zipcodeg = "90248" phone_number1g = "(310) 323-5410" phone_number2g = "" website2g = "" cursor.execute (""" INSERT INTO yellowpages(categories_name, business_name, business_address1, business_city, business_state, business_zipcode, phone_number1, website1, website2) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s') """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) cursor.close() conn.close() I keep getting this error File "testdb.py", line 51 """, (''gas-stations'', business_nameg, business_address1g, business_cityg, business_stateg, business_zipcodeg, phone_number1g, website1g, website2g)) ^ SyntaxError: invalid syntax any idea why? By the way, the up arrow is pointing to website1g (the b character) . Thanks for the help in advance

    Read the article

  • Map GEO API Services

    - by Lee
    Does anyone know of a good even paid API for mapping to get GEO stuff. I am really frustrated with google map giving poor results even though it beats all others. I have tried so far. Google Yahoo BING Mapquest Multimap Can anyone suggest other good services ? Hope ya CAN !

    Read the article

  • Android - How to Use SQLiteDatabase.open?

    - by Edwin Lee
    Hi all, i'm trying to use SQLiteDatabase.openDatabase( "/data/data/edwin11.myapp/databases/myapp.db", null, (SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.NO_LOCALIZED_COLLATORS)); to create/open a database instead of making use of the SQLiteOpenHelper (because i want to pass in the flag SQLiteDatabase.NO_LOCALIZED_COLLATORS. However, i am getting this exception for that line of code: 04-18 09:50:03.585: ERROR/Database(3471): sqlite3_open_v2("/data/data/edwin11.myapp/databases/myapp.db", &handle, 6, NULL) failed 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): java.lang.RuntimeException: An error occured while executing doInBackground() 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.os.AsyncTask$3.done(AsyncTask.java:200) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask.run(FutureTask.java:122) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.lang.Thread.run(Thread.java:1060) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): Caused by: android.database.sqlite.SQLiteException: unable to open database file 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1584) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638) ... Doing some testing just before that line of code (using File.isExists) shows that the file /data/data/edwin11.myapp/databases/myapp.db does not exist. Would that be the cause of the error? (Or am i just using SQLiteDatabase.openDatabase the wrong way?) Would it help if i create the file beforehand? (Shouldn't that be taken care of by the SQLiteDatabase.CREATE_IF_NECESSARY flag that i passed in?) If creating the file manually is the way to go, is it just an empty file, or do i have to write something to it? Thanks and Regards.

    Read the article

  • C#- Executing Exe without using System.Diagnostics.Process.Start

    - by Lee
    Hi all, I have a program that crashes when I execute it with System.Diagnostics.Process.Start in C#, but works fine if I execute a shortcut or batch file that runs the exe. Are there any alternative means of executing programs in C#, or any reasons why Process.Start might not work compared to the shortcut or batch file? I'd rather not have to generate a batch or shortcut file to run the application. Thanks

    Read the article

  • Google Map GEO Results

    - by Lee
    Hey All I'm getting really frustrated with google geo results and hope someone can advise me the best was to go. I have created a AutoSuggest feature where you can start typing the address and google will repspond with suggestions. User then selects and address to move on. But before I want them to continue on the next page I want to validate their selection. I would have thought this will be easy as we are only checking against what google has already given. But when I do my validation lookup it displays no results. Some example code: Lets say I picked from the suggestion this address: Suffield, CT 06078, USA Then on validation I do a second lookup with this address ie. $string = "Suffield, CT 06078, USA"; echo 'http://maps.google.com/maps/geo?output=json&oe=utf8&gl=us&sensor=false&key=[MyKey]&q='.urlencode($string).''; It gives me Error code 602 (G_GEO_UNKNOWN_ADDRESS) How can it not be found when its given me the address ?? Any suggestions how I can get around this. Hope you can !

    Read the article

  • get img src from an img loaded dynamically using jQuery

    - by Lee
    Hey Guys (and Ladies) I am looking at getting the image name from an image with a src loaded dynamically. Basically what I am doing is using the Google chat badge on a site to live chatting. And else where on the page, I have an image saying Live Chat:Online or Live Chat:Offline. And I want this to change depending on whether I am available to chat or not. Does this make sense? Anyway, the easiest way I figure to do this would be check the img url. If the img is offline.gif then obviously I am offline. An example of a dynamically loaded img would be something like <img src="http://www.google.com/talk/service/badge/Show?encrypted_acount_id_here" /> Once this image has loaded, it loads one of the following images "http://www.google.com/talk/service/resources/offlinef.gif" "http://www.google.com/talk/service/resources/idlef.gif" "http://www.google.com/talk/service/resources/onlinef.gif" Hopefully this make sense now. Thanks heaps

    Read the article

  • Windows App spellcheck

    - by Lee
    Hi... I was wondering if there is another way to spell check a Windows app instead what I've been of using: "Microsoft.Office.Interop.Word". I really don't want to buy a spell checking add-on.. and would like the spell check to be dynamic..any suggestions?

    Read the article

  • Flash AS3 undefined property MouseEvent in document class

    - by Lee
    Hi guys, this is my first time trying to use document classes in AS3 and im struggling. I am trying to add event listeners to a 2 levels deep movie clip, waiting for a click however i am getting the following error. ERROR: Access of undefined property MouseEvent package { import flash.display.MovieClip; import flash.media.Sound; import flash.media.SoundChannel; public class game extends MovieClip { public var snd_state = true; public function game() { ui_setup(); } public function ui_setup() { ui_mc.toggleMute_mc.addEventListener(MouseEvent.CLICK, snd_toggle); } public function snd_toggle(MouseEvent) { // 0 = No Sound, 1 = Full Sound trace("Toggle"); } } }

    Read the article

  • Error when instantiating .NET/COM interop class via classic ASP

    - by Lee D
    Hi all, I am having a problem when trying to instantiate a C# .NET class that's been exposed to COM in a classic ASP application. I've used tlbexp to generate a typelib and registered it in Component Services; now when trying to create the object as such: Server.CreateObject("The.Class.Name") I am getting the error: Server object error 'ASP 0177 : 80131534' Server.CreateObject Failed I've searched around online for information on this error, and found numerous discussions but no solution. The error code 0x80131534 apparently means "COR_E_TYPEINITIALIZATION, a type failed to initialize", which would suggest the problem would be in the constructor. The constructor of the class in question sets a private field to an instance of another class from the same assembly, and then reads some configuration settings from an XML file. This behaviour is unit tested and I've checked that the file exists; I can't see anything else that could be breaking in there. A few other points which may or may not be of use: A test .NET project referencing the DLL can instantiate the class just fine; however a test VB6 project referencing the TLB blows up with the same error. Both the DLL and the TLB are in the same location. This application is running locally, on Windows XP Professional SP3 and IIS 5.1. The .NET assembly is built with .NET Framework 2.0, although 3.5 is installed on the machine. I know other people who don't get this error on their builds, so I believe it may be something environmental. Any suggestions are welcome as I've been struggling to fix this for some time. Thanks in advance.

    Read the article

  • Execute remote Lua Script

    - by Bruno Lee
    Hi, I want to make an application that executes a remote script. The user can create a script (probabily a LUA script) then stores it in the server. Then he can uses an API for execute the script. I was thinking that API could be a webservice. So my questions are: I need high performance to execute the script. So my first choice was LUA script. Someone has another sugestion? Cause I need high perfomance, I was thinking if the webservice is the best solution. Maybe I could create a TCP/IP Windows Service that hold the users request. It is important to say that I will have many user executing scripts at the same time. So I will have a concurrency problem. My scripts will query in a database. I will use Tokyo Cabinet or Tokio Tyrant. I think Tokio Tyrant is the only solution cause I will have many requests. For perfomance, Do I need to make a connection pooling? Is there anyway to share variables between webservices requests? To make the webservice or the Windows service i was thinking to use C++. Can someone help with these questions? thanks

    Read the article

  • Bad Practice requiring file within a model?

    - by Lee Marshall
    I have built an MVC php application and was wondering, if instead of having to write out a large amount of html and set the data, could I not just have all this html (with some php) in a separate file and just require it? For example: $test = '<div> Test content <div>More content</div> </div>'; $APP->Template->setData('test', $test, FALSE); Instead could I not just use: $test = require("includes/content.php"); $APP->Template->setData('test', $test, FALSE); Would this be considered as bad practise? It just seems that by requiring files, it can shorten the length of controllers. Would be good to get anybodies advice on this matter.

    Read the article

  • ie8 playing funny with list-style-position: inside

    - by Lee
    Ok, So problem here... when using list-style-position:inside in IE8 the first like is indented but every line after that is not. So the new lines appear under the bullet. This is fine, but when I use a list with that css applied with an a tag within the li then the text automatically gets pushed to the second line, and the first line is empty. When I remove the a tag from the li then it jumps back up. Any idea on why this might be or is this a bug in the ie8 world or do I just need to double check my css? Any insights would be much appreciated.

    Read the article

  • RedirectMatch 301 for just html file

    - by Lee
    Hey All. I need to do a mass 301 Redirect for all pages ending with .html for my site. I am looking to move all the old .html files to a sub-folder ir. RedirectMatch 301 (.*)\.html$ http://www.domain.com/folder/$1.html When I add this and refresh the browser I get a ton of folder/folder/folder now after the url ie domain.com/folder//folder/folder/folder..... Any ideas what could be wrong? Thanks if you can help

    Read the article

  • Why does 6.times.map work in ruby 1.8.7 but not 1.8.6

    - by Lee
    The following code snippet works fine in 1.8.7 on Mac OS X, but not in 1.8.6 on Ubuntu. Why? Is there a workaround? Works in 1.8.7: $ ruby --version ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] ltredgate15:eegl leem$ irb >> 6.times.map {'foo'} => ["foo", "foo", "foo", "foo", "foo", "foo"] >> But not in 1.8.6: # ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux] Ruby Enterprise Edition 20090610 # irb irb(main):001:0> 6.times.map {'foo'} LocalJumpError: no block given from (irb):1:in `times' from (irb):1 irb(main):002:0> Why is there a difference? What's the workaround for 1.8.6?

    Read the article

  • MYSQL TRIGGER LOOP

    - by Lee
    Hey all I am going through the pain stacking process of sorting out someone else code. So I am decided to recreate a new database to sit alongside the old one then to use triggers to transfer data between both tables. Now I have an issue with a it looping IE A trigger on each table to update the other. Once one updates it should update the other but as both tables have triggers it just will loop which will cause an issue. Is their a way to stop this from happening ? Hope this makes sense and hope you can advise.

    Read the article

  • Do I need the bin\debug\appName.vshost.exe and appName.vshost.manifest in my SVN code repository?

    - by Bruce Lee
    I am building an application which is based on a sample application, written in C# on .NET 2, and is built on VS2008. This application is mostly a wrapper for a COM application. However I compile it in .NET 3.5. The sample application came with the following files in it's bin\debug: appName.vshost.exe appName.vshost.exe.manifest I noticed that I can delete the files and VS re-builds vshost.exe, and the vshost.manifest file appears with modification date the same as the deleted file as if VS has copied in from somewhere. My question is, should I put this files in my SVN code repository?

    Read the article

  • Removing file from Mercurial MQ Patch

    - by Nathan Lee
    I have large MQ patch applied in Mercurial. What has happened is I have done qrefresh and included files in my patch that I do not want to include. Is there a way to remove the changes to these file from my patch with out manually editing it? In this case if I was just working without MQ, all I would have to do is hg revert.

    Read the article

  • (PL/SQL)Oracle stored procedure parameter size limit(VARCHAR2)

    - by Jude Lee
    Hello, there. I have an problem with my oracle stored procedure as following. codes : CREATE OR REPLACE PROCEDURE APP.pr_ap_gateway ( aiov_req IN OUT VARCHAR2, aov_rep01 OUT VARCHAR2, aov_rep02 OUT VARCHAR2, aov_rep03 OUT VARCHAR2, aov_rep04 OUT VARCHAR2, aov_rep05 OUT VARCHAR2 ) IS v_header VARCHAR (100); v_case VARCHAR (4); v_err_no_case VARCHAR (5) := '00004'; BEGIN DBMS_OUTPUT.ENABLE (1000000); aov_rep01 := lpad(' ', 190, ' '); dbms_output.put_line('>> ['||length(aov_rep01)||']'); aov_rep01 := lpad(' ', 199, ' '); dbms_output.put_line('>> ['||length(aov_rep01)||']'); aov_rep01 := lpad(' ', 200, ' '); dbms_output.put_line('>> ['||length(aov_rep01)||']'); aov_rep01 := lpad(' ', 201, ' '); dbms_output.put_line('>> ['||length(aov_rep01)||']'); END pr_ap_gateway; / results : >> [190] >> [199] >> [200] and then error 'buffer overflow' ORA-06502: PL/SQL: ?? ?? ? ??: ??? ??? ?? ???? I know that VARCHAR2 type can contain 32KB in PL/SQL. But, in my test, VARCHAR2 parameter contains only 200 Bytes. What's wrong with this situation? This procedure will called by java daemon program. So, There's no declaration of parameters size before calling procedure. Thanks in advance for your reply.

    Read the article

  • Problem with socket communication between C# and Flex

    - by Chris Lee
    Hi all, I am implementing a simulated b/s stock data system. I am using flex and c# for client and server sides. I found flash has a security policy and I handled the policy-file-request in my server code. But seems it doesn't work, because the code jumped out at "socket.Receive(b)" after connection. I've tried sending message on client in the connection handler, in that case the server can receive correct message. But the auto-generated "policy-file-request" can never be received, and the client can get no data sending from server. Here I put my code snippet. my ActionScript code: public class StockClient extends Sprite { private var hostName:String = "192.168.84.103"; private var port:uint = 55555; private var socket:XMLSocket; public function StockClient() { socket = new XMLSocket(); configureListeners(socket); socket.connect(hostName, port); } public function send(data:Object) : void{ socket.send(data); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CLOSE, closeHandler); dispatcher.addEventListener(Event.CONNECT, connectHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(ProgressEvent.SOCKET_DATA, dataHandler); } private function closeHandler(event:Event):void { trace("closeHandler: " + event); } private function connectHandler(event:Event):void { trace("connectHandler: " + event); //following testing message can be received, but client can't invoke data handler //send("<policy-file-request/>"); } private function dataHandler(event:ProgressEvent):void { //never fired trace("dataHandler: " + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace("ioErrorHandler: " + event); } private function progressHandler(event:ProgressEvent):void { trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace("securityErrorHandler: " + event); } } my C# code: const int PORT_NUMBER = 55555; const String BEGIN_REQUEST = "begin"; const String END_REQUEST = "end"; const String POLICY_REQUEST = "<policy-file-request/>\u0000"; const String POLICY_FILE = "<?xml version=\"1.0\"?>\n" + "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n" + "<cross-domain-policy> \n" + " <allow-access-from domain=\"*\" to-ports=\"55555\"/> \n" + "</cross-domain-policy>\u0000"; ................ private void startListening() { provider = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); provider.Bind(new IPEndPoint(IPAddress.Parse("192.168.84.103"), PORT_NUMBER)); provider.Listen(10); isListened = true; while (isListened) { Socket socket = provider.Accept(); Console.WriteLine("connect!"); byte[] b = new byte[1024]; int receiveLength = 0; try { // code jump out at this statement receiveLength = socket.Receive(b); } catch (Exception e) { Debug.WriteLine(e.ToString()); } String request = System.Text.Encoding.UTF8.GetString(b, 0, receiveLength); Console.WriteLine("request:"+request); if (request == POLICY_REQUEST) { socket.Send(Encoding.UTF8.GetBytes(POLICY_FILE)); Console.WriteLine("response:" + POLICY_FILE); } else if (request == END_REQUEST) { Dispose(socket); } else { StartSocket(socket); break; } } } Sorry for the long code, please someone help with it, thanks a million

    Read the article

  • Help needed with AES between Java and Objective-C (iPhone)....

    - by Simon Lee
    I am encrypting a string in objective-c and also encrypting the same string in Java using AES and am seeing some strange issues. The first part of the result matches up to a certain point but then it is different, hence when i go to decode the result from Java onto the iPhone it cant decrypt it. I am using a source string of "Now then and what is this nonsense all about. Do you know?" Using a key of "1234567890123456" The objective-c code to encrypt is the following: NOTE: it is a NSData category so assume that the method is called on an NSData object so 'self' contains the byte data to encrypt. - (NSData *)AESEncryptWithKey:(NSString *)key { char keyPtr[kCCKeySizeAES128+1]; // room for terminator (unused) bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding) // fetch key data [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding]; NSUInteger dataLength = [self length]; //See the doc: For block ciphers, the output size will always be less than or //equal to the input size plus the size of one block. //That's why we need to add the size of one block here size_t bufferSize = dataLength + kCCBlockSizeAES128; void *buffer = malloc(bufferSize); size_t numBytesEncrypted = 0; CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding, keyPtr, kCCKeySizeAES128, NULL /* initialization vector (optional) */, [self bytes], dataLength, /* input */ buffer, bufferSize, /* output */ &numBytesEncrypted); if (cryptStatus == kCCSuccess) { //the returned NSData takes ownership of the buffer and will free it on deallocation return [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted]; } free(buffer); //free the buffer; return nil; } And the java encryption code is... public byte[] encryptData(byte[] data, String key) { byte[] encrypted = null; Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); byte[] keyBytes = key.getBytes(); SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES"); try { Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding", "BC"); cipher.init(Cipher.ENCRYPT_MODE, keySpec); encrypted = new byte[cipher.getOutputSize(data.length)]; int ctLength = cipher.update(data, 0, data.length, encrypted, 0); ctLength += cipher.doFinal(encrypted, ctLength); } catch (Exception e) { logger.log(Level.SEVERE, e.getMessage()); } finally { return encrypted; } } The hex output of the objective-c code is - 7a68ea36 8288c73d f7c45d8d 22432577 9693920a 4fae38b2 2e4bdcef 9aeb8afe 69394f3e 1eb62fa7 74da2b5c 8d7b3c89 a295d306 f1f90349 6899ac34 63a6efa0 and the java output is - 7a68ea36 8288c73d f7c45d8d 22432577 e66b32f9 772b6679 d7c0cb69 037b8740 883f8211 748229f4 723984beb 50b5aea1 f17594c9 fad2d05e e0926805 572156d As you can see everything is fine up to - 7a68ea36 8288c73d f7c45d8d 22432577 I am guessing I have some of the settings different but can't work out what, I tried changing between ECB and CBC on the java side and it had no effect. Can anyone help!? please....

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >