Giter Site home page Giter Site logo

rubo / flame Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 6.0 2.55 MB

Flame is an ActionScript library that provides a number of useful UI controls, collections, cryptographic services, and utilities to work with the Flex SDK.

License: Other

CSS 0.19% ActionScript 99.81%
cryptography encryption

flame's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flame's Issues

RSA 512 public key length is too short

Using Flame, here is a sample public key generated:

-----BEGIN PUBLIC KEY-----
MEoCAQACQLbkpbDFbZ54bM5ybwwdCqsUHjxWQF4B0Q1sAOBFEYdpxZJZ8dAzycPz
IgSlPc8yqjeqwJQtvCpktrntALpX1ksCAwEAAQ==
-----END PUBLIC KEY-----

Using Ruby OpenSSL, here is a sample public key generated:

-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMiZRXRL+l/m+HSu+QIikirFDTyTtXo4
PJZ2WU3nXYOFHsLrdwrBTR7KDYs+/w64TI7PuiuKXyKDqtRjf0UxHvUCAwEAAQ==
-----END PUBLIC KEY-----

OpenSSL::PKey::RSA.new(512).public_key

Why is there a difference in the length?

SHA-3

Hello, I couldn't find any SHA-3 library for ActionScript. Is there any exist or do you know any ?

ECDSA signature verification failure

I couldn't find any test-cases or examples with your ECDSA code, so maybe I'm missing something, but I don't think so. The code below produces an invalid signature (even though it uses the same ECDSA instance for signature and verification, supposedly using the private/public keypair generated when the object is instantiated). I've tried compiling from the source code, and using the SWC as well - same result. RSA works fine.

var ba:ByteArray = new ByteArray();
ba.writeUTF("testing123");

var sha256:SHA256 = new SHA256();

var hash:ByteArray = sha256.computeHash(ba);

var ecdsa:ECDSA = new ECDSA(256);

var signature:ByteArray = ecdsa.signHash(hash);

var valid:Boolean = ecdsa.verifyHash(hash, signature);

trace('signature valid: ' + valid); // signature valid: false

Encrypt using RSA private key instead of public key

It seems that RSAPKCS1KeyExchangeFormatter encrypts data using the public key.

In my use case, I only want one "provider" to be able to send several "consumers" encrypted messages. Thus, I want the "provider" (i.e. my flash app) to encrypt data using the private key and my "consumers" to decrypt data using the public key.

Is there a straightforward way I can create a cipher using the private RSA key instead of the public key?

Thanks!

Convert RSA key pair in flame to pem

hey, I see a from/to xml conversion method, but I would like to generate a key pair using your library and get the pem output like the following:

"-----BEGIN RSA PRIVATE KEY-----\nMIIBPAIBAAJBALjIM++FdT3DtzOf9Z0TOBFJrbPdo6aU2xXtuNdURZbEdeTKO2SH\n2tMoijOy+X66U7aNwvzblvSq/PPJcxJkFz0CAwEAAQJBAKjYn8R1cc1Pgp8Uwo2W\nWzxI1AWwOHLmQE+IWsfARJpfOTw8nhw3Jbknw9rd2RaKpjXv0EzKanjxrXi3iVtp\n8o0CIQDw+v1JpEP6/V8vWgJYVgHJwi03lht0dyg9bjDorHkG8wIhAMRMh3JK4opS\n42OEXooiDIYaztodtiOULf9L+8kTilUPAiAFhOoaLq3z6KuubPRSy5183nqkpEZ6\ns2PzjDuIiLK46wIhAJYlMzTosn67B9KG3QkrIgkxWCbdswNjxAsSQ3R5zcVhAiEA\n2Y+g+iMEQdp4lSXJ7jCkI0lb5URrH2gUQpvx3aoTvs4=\n-----END RSA PRIVATE KEY-----\n"

any ideas on how I can do this?

thanks

Padding Strategy for RSA encrypt/decrypt

Main question:

What padding strategy do the RSA encrpyt/decrypt methods use in flame? Is it PKCS1_PADDING by default? Something else?

--- Context ---

I have successfully generated RSA key pair using your library and have tested it successfully in flash by encrypting/decrypting various strings. I am now try to encrypt a string using the flame library and decrypt the result using Ruby's OpenSSL::RSA library.

Flash:
sample string = "testfootest"
Base64 urlsafe encoded result:

"Zi1e8kz9TVb99EU0aZQ7heY4ecN7v6WFeR8Il6tKYnsuSF9MUZq8ReY2a9lslMNALBggi7Wzneq2LDTdeNPllA=="

Ruby:
I create the RSA key pair using the private key generated by flame.
When I try to decrypt the encrypted result, I get the following error:

OpenSSL::PKey::RSAError: padding check failed
from (irb):12:in public_decrypt' from (irb):12 from /Users/dhracker/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:47:instart'
from /Users/dhracker/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in start' from /Users/dhracker/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:41:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.