Posts

RSA Encryption process in PHP -

Image
in effort understand asymmetric encryption process outlined simple php script encrypt , decrypt simple numbers. noticed after while given numbers encrypt/decrypt algorithm fail, in decrypted , initial numbers didn't match. put loop in see how algorithm perform when ecrypting , decrypting 100 numbers , after number 32 process fell apart. is because p*q = 33? <?php # test encrypto algo // choose prime keys $p = 47; $q = 71; // compute n = pq $n = $p*$q; // choose e such 1 < e < f(n) , e , n coprime $e = 79; // compute value d such (d * e) % f(n) = 1 $d = 1019; // compute f(n) = (p-1)(q-1) $z = ($p - 1)*($q - 1); // create public , private keys $pubk = array('n' => $n, 'e' => $e); $privk = array('n'=> $n, 'd' => $d); // boundary loop $l = 100; // perform encypt/decrypt on 1..100 for($i = 1; $i <= $l; $i++) { $enc = enc($i, $pubk); $dec = dec($enc, $privk); print "encrypted <b>$i</b> = $enc...

wix - Custom Bootstrapper created using wix3.6 is not unistalling the msi -

i'm installing msi package (my.msi) custom managed bootstrapper created using wix3.6 burn, bootstrapper first installs few prerequisite packages , installs my.msi. the installation working , there issue uninstallation. on uninstallation bootstrapper closes without uninstalling anything, on checking logs bootstrapper logging plan as: [1c10:2d80][2013-05-14t16:22:26]i201: planned package: my , state: present, default requested: absent, ba requested: absent, execute: uninstall, rollback: install, cache: no, uncache: yes, dependency: unregister i'm calling bootstrapper.engine.plan(launchaction.uninstall) in managed code uninstalling application. im not seeing other relevant information in log file. does 1 have suggestions? thanks. i've found solution link http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/how-to-uninstall-burn-bundle-td7579345.html i've specified exitcode behavior=”schedulereboot” 1 of pre-requiiste packages.

c# or VB.net About casting an object into a datatype -

is there way able cast object depending on whats datatype written string after instanciating through relfection? example: string datatype = "list<genericclassname>"; list<genericclassname> o = (datatype)dynamicallyinstantiateclass("namespace.classname"); of course can : dynamic d = activator.createinstance("assemblyname","typename"); d.dosomthing(); to find assembly name right click on projects own's class in application tab can find type assembly name

c# - WebRequest GetResponse stuck with default proxy -

i have following code private bool isonline() { try { var wr = webrequest.createhttp("http://www.google.com"); wr.keepalive = false; wr.credentials = credentialcache.defaultcredentials; using (wr.getresponse()) { return true; } } catch { return false; } } when execute it remains stuck on getresponse line forever. thanks responses found problem in default proxy. in fact if construct new proxy in following way works var registry = registry.currentuser.opensubkey("software\\microsoft\\windows\\currentversion\\internet settings", false); var proxy = (string)registry.getvalue("proxyserver"); var isproxyenabled = (int)registry.getvalue("proxyenable"); if (isproxyenabled > 0) { wr.proxy = new webproxy(proxy, true, null, system.ne...

c# - Implicit transaction with explicit implementation -

as framework developper, provide implicit transaction scope environment works across threads. this imply committabletransaction created existing ambiant transaction if any. could create commitabletransaction ambiant transaction ? i'll try implement new transactionscope using concept explained here .

c++ - How to deallocate an element in a vector of pointers? -

so have vector of pointers so: vector<example*> ve; i fill vector pointers this example* e = new example(); ve.push_back(e) but when want remove them, how assure deallocated? enough? ve.erase(ve.begin() + 1) delete ve[1] you have other way round, of course: delete ve[1]; ve.erase(ve.begin() + 1); however, it's vastly more preferable use smart pointers (such std::unique_ptr ) instead of raw pointers when expressing ownership.

jquery - Error callback doesnt have the details in IE -

i calling ajax call in app , error callback doesn't have error details in internet explorer, other browsers working fine app.api.remoteupload(datacall, url, function (data, status) { alert(data); }, function (error, status) { alert(error); }); alert(error) empty object in ie error condition, others browsers working fine. thoughts ? thanks,