Code Monkey home page Code Monkey logo

jerson / flutter-openpgp Goto Github PK

View Code? Open in Web Editor NEW
64.0 4.0 22.0 374.88 MB

OpenPGP for flutter made with golang for fast performance with support for android, ios, macos, linux, windows, web and hover

Home Page: https://pub.dev/packages/openpgp

License: MIT License

Java 0.38% Ruby 1.49% Objective-C 0.20% Dart 70.82% HTML 0.35% C 6.02% C++ 7.89% Swift 0.53% JavaScript 5.60% CMake 5.42% Shell 1.07% Makefile 0.09% Dockerfile 0.09% Kotlin 0.04%
golang openpgp flutter pgp xcode android ios linux macos windows

flutter-openpgp's Introduction

OpenPGP

Library for use openPGP with support for android, ios, macos, windows, linux and web

Integration Tests Android

Integration Tests Linux

Integration Tests Windows

Integration Tests iOS

Integration Tests macOS

Contents

Usage

Generate methods

void main() async {
    var keyOptions = KeyOptions()..rsaBits = 2048;
    var keyPair = await OpenPGP.generate(
            options: Options()
              ..name = 'test'
              ..email = '[email protected]'
              ..passphrase = passphrase
              ..keyOptions = keyOptions);
}

Encrypt methods

void main() async {
    var bytesSample = Uint8List.fromList('data'.codeUnits);
    
    var result = await OpenPGP.encrypt("text","[publicKey here]");
    var result = await OpenPGP.encryptSymmetric("text","[passphrase here]");
    var result = await OpenPGP.encryptBytes(bytesSample,"[publicKey here]");
    var result = await OpenPGP.encryptSymmetricBytes(bytesSample,"[passphrase here]");

}

Decrypt methods

void main() async {
    var bytesSample = Uint8List.fromList('data'.codeUnits);
    
    var result = await OpenPGP.decrypt("text encrypted","[privateKey here]","[passphrase here]");
    var result = await OpenPGP.decryptSymmetric("text encrypted","[passphrase here]");
    var result = await OpenPGP.decryptBytes(bytesSample,"[privateKey here]","[passphrase here]");
    var result = await OpenPGP.decryptSymmetricBytes(bytesSample,"[passphrase here]");

}

Sign methods

void main() async {
    var bytesSample = Uint8List.fromList('data'.codeUnits);
    
    var result = await OpenPGP.sign("text","[privateKey here]","[passphrase here]");
    var result = await OpenPGP.signBytesToString(bytesSample,"[privateKey here]","[passphrase here]");
    
    // sign including data
    var result = await OpenPGP.signData("text","[privateKey here]","[passphrase here]");
    var result = await OpenPGP.signDataBytesToString(bytesSample,"[privateKey here]","[passphrase here]");

}

Verify methods

void main() async {
    var bytesSample = Uint8List.fromList('data'.codeUnits);
    
    var result = await OpenPGP.verify("text signed","text","[publicKey here]");
    var result = await OpenPGP.verifyBytes("text signed", bytesSample,"[publicKey here]");
    
    // verify signed with data
    var result = await OpenPGP.verifyData("text signed","[publicKey here]");
    var result = await OpenPGP.verifyDataBytes(bytesSample,"[publicKey here]");

}

Encode methods

void main() async {
    var bytesSample = Uint8List.fromList('data'.codeUnits);
    
    var result = await OpenPGP.armorEncode("PGP MESSAGE", bytesSample);
}

Decode methods

void main() async {    
    var result = await OpenPGP.armorDecode("message here");
}

Metadata methods

void main() async {
    var result = await OpenPGP.getPrivateKeyMetadata("[privateKey here]");
    var result = await OpenPGP.getPublicKeyMetadata("[publicKey here]");
}

Convert methods

void main() async {
    var result = await OpenPGP.convertPrivateKeyToPublicKey("[privateKey here]");
}

Setup

Android

No additional setup required.

iOS

No additional setup required.

Web

Add to you pubspec.yaml.

assets:
    - packages/openpgp/web/assets/worker.js
    - packages/openpgp/web/assets/wasm_exec.js
    - packages/openpgp/web/assets/openpgp.wasm

ref: https://github.com/jerson/flutter-openpgp/blob/master/example/pubspec.yaml

MacOS

No additional setup required.

Linux

No additional setup required.

Windows

No additional setup required.

Example

Inside example folder.

cd example && flutter run

check our web demo: [https://flutter-openpgp.jerson.dev/]

Native Code

Native library is made in Go for faster performance.

[https://github.com/jerson/openpgp-mobile]

Upgrade Library

You need to run

make upgrade

Tests

You need to run

make test

flutter-openpgp's People

Contributors

bobanalappat avatar delaosa avatar irasekh3 avatar jerson avatar jerson-av avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

flutter-openpgp's Issues

invalid data: tag byte does not have MSB set

Hello,

For studies graduation I wroted android app to send and download encrypted files with API wroted in C#.
When I encrypted file via openpgp in android, I can decrypt this in C# and everything is fine, when I encrypted file in C# using public key generated by openpgp, I can't decrypt that file in android app. I getting error: openpgp:
"invalid data: tag byte does not have MSB set"

Future decryptFile(String filePath, String temporaryPath, String privateKey, String passPharse) async {
try {
var result = await pgp.OpenPGP.decryptBytes(File(filePath).readAsBytesSync(), privateKey, passPharse);

File file = await File(temporaryPath).create(recursive: true);
file.writeAsBytesSync(result);

} catch (err) {
print(err);
}
}

Could you try help me, where should be problem? It's last stage to end this project.

Android APK contains other Abi versions

After realizing an apk built using flutter build apk --target-platform android-x64, it contains all Abi versions of openpgp.

In there a way to only the use targeted one? This would reduce the APK size a lot.

Recommendation: Method to change private key password

I am looking for a way to change the private key password without regenerating the key pair. An OpenPGP method would be very helpful for this purpose. Is there a way to do this using fast_rsa? A code example/snippet would be much appreciated.

gpg-tools not supported?

i encrypted a zip file using await OpenPGP.encryptBytes(bytes, 'pubkey') when i decrypt the file using gpg-tools it gives this error
Screenshot 2020-11-04 at 5 07 42 PM

if decrypt using await OpenPGP.encryptBytes() have no issue

pgrok

You dont have Issues setup on the pgrok repo, so am writing the issue here if you dont mind..

I have forked pgrok so i can PR some changes.

  1. Gateway . Add LetsEncrypt for the Server so the Certs are gotten at runtime. Will be a wildcard cert.
  • will be saved on file system and later in an encrypted DB
  1. Client
  • Auth token from the client sent to the server. If the auth token and subdomain matchup up the Server gateway will return to the Client the Certs.

is that useful for you too ?

supporting PGP/MIME format?

Screenshot 2020-10-01 at 10 06 47 AM

the output of Encrypt method looks like just a PGP encrypted result
await OpenPGP.encrypt("text","[publicKey here]")

does this package support return in PGP/MIME format?

Failed to load dynamic library 'libopenpgp_bridge.so'

I tried the plugin recently and it works flawlessly on Windows. However when I try to build a project which depends on flutter-openpgp on Linux, the location of libopenpgp_bridge.so seems to be incorrect.
In my case I cannot find out libopenpgp_bridge.so in ${PROJECT_NAME}/build/linux/x64/${BUILD_FLAVOR}/bundle/lib/ with both debug and release build, thus getting flutter: Invalid argument(s): Failed to load dynamic library 'libopenpgp_bridge.so': libopenpgp_bridge.so: cannot open shared object file: No such file or directory output on debug console. Then I found that file at ${PROJECT_NAME}/build/linux/x64/${BUILD_FLAVOR}/plugins/openpgp/bundle/lib/ and copy it to the first one, letting openpgp back to work.
Could you please make a fix? So that we don't need to move that file manually every time.
Thanks.

`version solving failed` because of ffi

I hope this is the right place to discuss this.

I can't add any newer version of openpgp other than 9.9.0 because of the ffi dependency.
When using this package with device_info_plus you get the following error when trying to manually set to any newer version:

Because device_info_plus_windows 3.0.1 depends on ffi ^2.0.1 and no versions of device_info_plus_windows match >3.0.1 <4.0.0, device_info_plus_windows ^3.0.1 requires ffi ^2.0.1.
And because openpgp >=1.2.0-nullsafety.4 depends on ffi ^1.0.0, openpgp >=1.2.0-nullsafety.4 is incompatible with device_info_plus_windows ^3.0.1.
And because device_info_plus 4.0.1 depends on device_info_plus_windows ^3.0.1 and no versions of device_info_plus match >4.0.1 <5.0.0, openpgp >=1.2.0-nullsafety.4 is incompatible with device_info_plus ^4.0.1.
So, because myproject depends on both device_info_plus ^4.0.1 and openpgp ^3.3.0, version solving failed.
pub get failed (1; So, because myproject depends on both device_info_plus ^4.0.1 and openpgp ^3.3.0, version solving failed.)

OpenpgpPlugin not instantiating properly on android

It seems that the example you wrote is triggering onAttachedToEngine when instantiating and registering the OpenpgpPlugin. However, I am working on an app that seems to be registering the plugin with the registerWith. Unfortunately it seems that registerWith is not properly instantiating
private FastOpenPGP instance; or private Handler handler;.

When I do run the plugin as it stands today and try to generate a key pair I get the following nullpointer exception:

E/AndroidRuntime( 5642): FATAL EXCEPTION: Thread-3
E/AndroidRuntime( 5642): Process: com.example.app, PID: 5642
E/AndroidRuntime( 5642): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Handler.post(java.lang.Runnable)' on a null object reference
E/AndroidRuntime( 5642): 	at dev.jerson.openpgp.OpenpgpPlugin.error(OpenpgpPlugin.java:146)
E/AndroidRuntime( 5642): 	at dev.jerson.openpgp.OpenpgpPlugin.access$200(OpenpgpPlugin.java:26)
E/AndroidRuntime( 5642): 	at dev.jerson.openpgp.OpenpgpPlugin$9.run(OpenpgpPlugin.java:295)
E/AndroidRuntime( 5642): 	at java.lang.Thread.run(Thread.java:919)
I/Process ( 5642): Sending signal. PID: 5642 SIG: 9
Lost connection to device.
Exited (sigterm)

armorDecode or something

Hello,

I have to encode and later - decode a binary file into and from armored (ASCII) message format.

For encoding I do:

Future<String?> encryptBinary(Uint8List data) async {
    var encoded = await OpenPGP.encryptBytes(data, pubKey);
    return OpenPGP.armorEncode(encoded);
}

But for decoding a String into binary ther is no way - there is no armorDecode() function or something.

Is there any way I can do it?

Integration with yubikey

Hello

excuse my request because it's not an issue :)
is it possible to integrate your work with Yubikey (smartcard) ? Do you know this device ?
Thx

Linux setup instructions outdated

The instructions for the Linux setup seem to be pretty old. Could you provide new ones?

Currently, the referenced linux/app_configuration.mk file is no longer used and though the plugin no longer works for Linux throwing a MissingPluginException...

Anyway, thank you for this great plugin!

use in native JAVA android

how can I use this library in native JAVA android application?
there are some compiled file inside the android folder.

Failed to load dynamic library

Hi! First of all, thank you for your work doing this library is amazing!

I have an issue running some test in MacOS (i5, not Apple silicon) machine, this is the stackTrace

ArgumentError (Invalid argument(s): Failed to load dynamic library 'libopenpgp_bridge.dylib': dlopen(libopenpgp_bridge.dylib, 0x0001): 
tried: '/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/./libopenpgp_bridge.dylib' (no such file), 
'/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/../../../libopenpgp_bridge.dylib' (no such file),
'/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/Frameworks/libopenpgp_bridge.dylib' (no such file),
'/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/./libopenpgp_bridge.dylib' (no such file), '/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/../../../libopenpgp_bridge.dylib' (no such file), 
'/Users/alfredo/flutter/bin/cache/artifacts/engine/darwin-x64/Frameworks/libopenpgp_bridge.dylib' (no such file), 'libopenpgp_bridge.dylib' (no such file), '/usr/lib/libopenpgp_bridge.dylib' (no such file), 
'/Users/alfredo/Desktop/handcash_flutter_core/libopenpgp_bridge.dylib' (no such file), '/usr/lib/libopenpgp_bridge.dylib' (no such file))

This is the method I'm using

OpenPGP.encrypt(number, publicKey)

Flutter version: 2.8.0, MacOS version: Monterrey 12

ios build - cant find podhelper

I am getting:

[!] Invalid `Podfile` file: cannot load such file --
    /Users/apple/workspace/flutter/packages/flutter_tools/bin/podhelper.

repro:

        # pod clean
	cd $(LIB_FLU_SAMEPLE_FSPATH)/ios && rm -f ./Podfile.lock
	cd $(LIB_FLU_SAMEPLE_FSPATH)/ios && rm -rf ./Pods
	cd $(LIB_FLU_SAMEPLE_FSPATH) && flutter clean
	# pod setup
	cd $(LIB_FLU_SAMEPLE_FSPATH) && flutter pub get
	cd $(LIB_FLU_SAMEPLE_FSPATH) && flutter build ios
	
	cd $(LIB_FLU_SAMEPLE_FSPATH)/ios && pod install
	# run it
	cd $(LIB_FLU_SAMEPLE_FSPATH) && flutter run -d iPhone

I think it might be because of the flutter channel i am on, as this current Issue on Flutter tree seems to be exactly what it the problem.
flutter/flutter#59522

Fetch and upload keys from/to keyservers

In order to provide all required features for all-day PGP use, It would be great to have support for key server communication such as searching keys by ID, Fingerprint or mail address, fetching found keys and uploading keys to self-specified key servers.

Are there any plans to integrate key server support?

make and signing

@jerson

Regarding the CI builds.
I am working on a mage based system which uses the same code to build the golang and flutter stuff locally and in github workflows. Its maybe 80% done. Will let you know when its ready for trying out. Its a mess right now as i have had to work on other stuff.
Then there is one way to build for local and ci, and its 100% golang driven.

I am also working on signing for all of the binaries also.
Have not cracked yet how to sign the go-flutter DMG and MSI yet. it will be integrated into the mage file and so do it automatically.
For Apple i am using this: https://github.com/mitchellh/gon

Let me know your thoughts....

Arror including the Android aar file

When building for Android, I am having trouble including the AAR file:

Running "flutter pub get" in client...                             974ms
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
                                          
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':openpgp:bundleReleaseAar'.                  
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :openpgp project caused this error: /home/name/.pub-cache/hosted/pub.dartlang.org/openpgp-0.9.9/android/libs/openpgp.aar
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 37s  
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                    1,970ms
Gradle task assembleRelease failed with exit code 1

Is there any way to solve this issue?

Incorrect location of libopenpgp_bridge.so on Linux platform

Hi!
I tried the plugin recently and it works flawlessly on Windows. However when I try to build a project which depends on flutter-openpgp on Linux, the location of libopenpgp_bridge.so seems to be incorrect.
In my case I cannot find out libopenpgp_bridge.so in ${PROJECT_NAME}/build/linux/x64/${BUILD_FLAVOR}/bundle/lib/ with both debug and release build, thus getting flutter: Invalid argument(s): Failed to load dynamic library 'libopenpgp_bridge.so': libopenpgp_bridge.so: cannot open shared object file: No such file or directory output on debug console. Then I found that file at ${PROJECT_NAME}/build/linux/x64/${BUILD_FLAVOR}/plugins/openpgp/bundle/lib/ and copy it to the first one, letting openpgp back to work.
Could you please make a fix? So that we don't need to move that file manually every time.
Thanks.

Look for help, the compression of KeyOptions does not work.

hello @jerson , when I use this library, I hope to specify the compression and cipher field of the KeyOptions class, but it doesn't work. How can i fix it?
The example code is as follow:

class TestOpenPGP extends StatefulWidget {
  const TestOpenPGP({super.key});

  @override
  State<TestOpenPGP> createState() => _TestOpenPGPState();
}

class _TestOpenPGPState extends State<TestOpenPGP> {
  String _encryptData = '';
  KeyPair? _keyPair;

  Future<KeyPair> get keyPair async {
    _keyPair ??= await OpenPGP.generate();
    return _keyPair!;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SizedBox(
      width: double.infinity,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          ElevatedButton(
              onPressed: _testEncryptPerformance, child: Text('test encrypt')),
          ElevatedButton(
              onPressed: _testDecryptPerformance, child: Text('test decrypt')),
        ],
      ),
    ));
  }

  void _testEncryptPerformance() async {
    final keyOptions = KeyOptions()
      ..compression = Compression.ZLIB
      ..cipher = Cipher.AES128
      ..compressionLevel = 1;
    final publicKey = (await keyPair).publicKey;
    _encryptData = await OpenPGP.encrypt(
        '[{"title":"hello", "content":"world"},{"title":"hello", "content":"world"},{"title":"hello", "content":"world"},{"title":"hello", "content":"world"}]',
        publicKey,
        options: keyOptions);
    print('====> encryptData: $_encryptData');
  }

  void _testDecryptPerformance() async {
    final keyOptions = KeyOptions()
      ..compression = Compression.NONE
      ..cipher = Cipher.CAST5
      ..compressionLevel = 1;
    final privateKey = (await keyPair).privateKey;
    final decryptData = await OpenPGP.decrypt(
        _encryptData, privateKey, "password",
        options: keyOptions);
    print('====> decryptData: $decryptData');
  }
}

My Flutter SDK info is as follow:

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.1.1 23B81 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.89.0)
[✓] Connected device (4 available)
[✓] Network resources

The version of openpgp is 3.7.2

Implement PublicKey and PrivateKey classes supporting metadata, fingerprint etc.

It would be great to see classes for both public and private keys the following way:

abstract class Key {
Key formArmored(String key);
Key formBinary(Uint8List key);
}

class PublicKey extends Key {
}

class PrivateKey extends {
}

This is necessary for basic PGP functions like determination of key's name, address, expiry and fingerprint.

In the future, methods for generating revocation certificates and export to armored / binary keys.

Thank you very much for this package.

OpenPGP.generate() pub key is unusable in other openpgp libraries

Hello @jerson

on version 3.7.1 I do something like this:

var keypair = await OpenPGP.generate();
await updateAgentPublicKey(keypair.publicKey); // sends pubkey to the server, where it is verified and checked

And serverside pubkey verification give an error:

"ValueError: 39 is not a valid backing value for enum OpenPGP\Enum\SignatureSubpacketType"

iOS compiling error

Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Undefined symbols for architecture arm64:
"OBJC_CLASS$_OpenpgpOptions", referenced from:
objc-class-ref in OpenpgpPlugin.o
"OBJC_CLASS$_OpenpgpKeyOptions", referenced from:
objc-class-ref in OpenpgpPlugin.o
"_OpenpgpNewFastOpenPGP", referenced from:
-[OpenpgpPlugin setup] in OpenpgpPlugin.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Could not build the precompiled application for the device.

Make it easier to code gen the flutter <--> embedded golang bridge code

Looks like you and others have the same intent as me :)

What do you think about this idea ??

If the API between the flutter layer and the embedded golang layer was a Protobuf, then we could code gen a ton of the code
For example you need to hand code the dart <--> golang method channels, but this can easily be code generated by sniffing the protobufs later.

The relevant code touch points are here:
Flutter Native bridge:
https://github.com/jerson/flutter-openpgp/blob/master/lib/openpgp.dart#L14
Flutter Web bridge:
https://github.com/jerson/flutter-openpgp/blob/master/lib/web/openpgp_web.dart

decryption give a null value.

flutter: encrypt -----BEGIN PGP MESSAGE-----
Version: fast-openpgp
wcBMA9/efA5kSCbZAQgAClkZi61CJKr4D9R0boaB9LKzIbzfOCLsPIuFzOCZfAeb
p5jGsKgRsO621PafIF/oywVnAgEMGw17EdPv6i5C3Ldw/FspSwh5YvzOmRmiZ8CB
bRwSXKLxTS/4zvX7y3PcwZCnVmIiB/tZHCBhXrvemUSdffzFt+VxbzoY4fG0xHKL
yWKyxbqotMXkOM2/iruFea4D2AVl0kJQKSzv7DYatEnMDf7BkJHY5VTeOipaoT8T
NCsIm3z/F2o88/ZI7rUZxIedB2q7mak29RJYrAti5b/t9iB44EsElO2vIdeEz4/a
BpGdunNiblv1FsABEQARJ981UQA6NcBy/9DajG3EYNLgAeQVTpUf/+UXqLoT3v4D
2T7d4cu84PXg7+E+p+C44kiiACHgEOJDv1SN4OPkOjaqnb26itBpz1j51SiDB+I8
tmn14Ze8AA==
=qbtz
-----END PGP MESSAGE-----
flutter: sign -----BEGIN PGP SIGNATURE-----
Version: fast-openpgp
wsBcBAABCAAQBQJfa1l7CRD1suCFGU4uKQAA3+oIAFILjiVSq6rt4drqUBLk46ey
E+GQn8iAibJN/QicJGmciXjfbSgYgyT8R/rE9y4F/HN70GxugDxTfuzxtkvEzrq+
dnTCwqQzH19hrJXBagqfVte7qdkN6gx5Fk8aoqUNh1XL22mCFD/j0n2CgMGBC2ZV
19Hb2dO/RakYRIsJJkd1C8N7tLSCvoeHiMVXi1+WT3lsxN0dSoQYLHyUrCnvVcFq
9qAihYnmp4RADZ17veXvmULb6kOaoYyYLDNnbFd9itjkpagTTWKI/3xaE0HdTe3R
wr1+OIt2EDFcI8uk2yfbnPDOCljvBPF9LKyp1ZOntSYGB84UyfnXF0ZRUJAd8vE=
=IEcg
-----END PGP SIGNATURE-----
flutter: verify: true
flutter: PlatformException(1, Error Domain=go Code=1 "EOF" UserInfo={NSLocalizedDescription=EOF}, null)
flutter: decrpt null

gpg command generated public key does not works?

i used gpg --full-generate-key to generate an rsa-3072 bit key having error

this is the sample pubkey result generating from open pgp package (this works pefectly fine) but

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: fast-openpgp

xo0EX3Pp9AEEAM2lKlXSGOuB4+p2HnkQe5hYRY+Gu1/kNFzAGnPvgxpKi6TaoJHC
fdU8ZDF1jNdP+CyKI/cBEuhoa+ZSgz/imOfcjHIQvAHsCulqusdXzUzrPhNFOV7h
7fS3Z57C1XUMbIpIBWnu5F6FY8cimu/5A1dSoDyZAFHgldSNt0aCgZxdABEBAAHN
FHRlc3QgPHRlc3RAdGVzdC5jb20+wqgEEwEIABwFAl9z6fQJEHZ8hdIAMBRWAhsD
AhkBAgsHAhUIAAB/IQQAxrmmQ/GOT2DTDuvAhBd9UW3k+ObEmH6U96Omt+fHAhnd
4Jp993XYSotUoJBhcxX253+HcKXYn7BpFZaA5w057rd6A+1zrMlxHGn0rdbDCjdp
nFw+6geV4VR8ELVwhCIxoppZ4tUlTi47yDlLyy6Uyv/I28cgzd1Co8TFUjiNBFbO
jQRfc+n0AQQAqPPR+20ukLJZ5yQjtIRsrIJsl1g85I1WQpSI7Za4S3x5TSn4/mlS
Yqzw167Pw5DQJZ+whnU9OspPmteZXr9JyrRE5QFhTMXZaIftVL5KKNOGYtM6Jc92
qAbVT5K1cXGoN15EuxfVabzqWcX/rTdBoBo+lUyDZ/+whg7IP0xKuo8AEQEAAcKf
BBgBCAATBQJfc+n0CRB2fIXSADAUVgIbDAAA38EEAFTpfR4Xk7w5HITFB4kH4TJC
Pf/bDABShm+/Y7/CUsHJNzimpKDBDaRQ5Vw1BEDAF2ba6zXMRTzrW9z9hh3gFpxk
vGZiOsQfFvpIJuZ1I8TxQgZkxkXtHKbMyFzHy/Jv4AKGlbJfGgxpqrstjUZ7sRit
d2Zd2N4xVJuQg3hrj9PY
=F7Xg
-----END PGP PUBLIC KEY BLOCK-----

this is a sample pubkey i generated using the gpg command
reason being i only can retrieve the pubkey from my server
when i use this sample pubkey i generated to encrypt it throws error
even if i copy from starts from -----BEGIN PGP PUBLIC KEY BLOCK-----
any idea why it throws this error? thanks

Unhandled Exception: PlatformException(1, Error Domain=go Code=1 "openpgp: invalid data: first packet was not a public/private key" UserInfo={NSLocalizedDescription=openpgp: invalid data: first packet was not a public/private key}, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:572:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:161:18)
<asynchronous suspension>
#2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
#3      OpenPGP.encrypt (package:openpgp/openpgp.dart:31:27)
This is a revocation certificate for the OpenPGP key:

pub   rsa3072 2020-10-02 [S]
      E1E1C39BBBCFE4C18D6C80610F626FFCBEE5A365
uid          winnie (testing) <[email protected]>

A revocation certificate is a kind of "kill switch" to publicly
declare that a key shall not anymore be used.  It is not possible
to retract such a revocation certificate once it has been published.

Use it to revoke this key in case of a compromise or loss of
the secret key.  However, if the secret key is still accessible,
it is better to generate a new revocation certificate and give
a reason for the revocation.  For details see the description of
of the gpg command "--generate-revocation" in the GnuPG manual.

To avoid an accidental use of this file, a colon has been inserted
before the 5 dashes below.  Remove this colon with a text editor
before importing and publishing this revocation certificate.

:-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: This is a revocation certificate

iQG2BCABCAAgFiEE4eHDm7vP5MGNbIBhD2Jv/L7lo2UFAl92i44CHQAACgkQD2Jv
/L7lo2WZugv/RFv8ktklJ4aJM+vEETuaZuRmAVGfOI5ta0j2BjZd4vR2Mty1Hol3
42zjfGxrAm9O2LN44GsiD/l6fm4FSpqdXUAIjxQH1Vbl41+rtN+NXVUGOCcjJB1m
sYK4ywJqECMan66OU6z6DvYBL+f1jZ4b9t9hJXK+BXP4BhcEiP5dNJvnDcdVky7O
OKl3eVjl0vVOSU0B54Oj1mNXYN17QY3rNtjS23XTlJNfLpYLUHX4bYyPp50mvqUg
TWHGM3ixycgNnCofeltY+aDNTgaYozdW4gcbC30uf3noflYxpF1eX2S/W7w39ToQ
HCcZsTL2K8YOaJt1HJr6VJcApSnN6bpg8F2gT0WQ3e9PwYGjUDwfeNCy3jj2xHPg
zsuGo4N3KyOiFhAqPHECgQnzmdGxUQkVbao8oW8cvYae5bMITwywSjeGrKit9aw/
cSqbgoD7q0uFkCXwJ0VggJNu6UJxAVEGVyXSTdqbJxE8QAkmvlRcIK0S9BD9/+fJ
GWi0uVKVUb9K
=Uy+2
-----END PGP PUBLIC KEY BLOCK-----

Recommendation: dart SDK support

I really like this package but it would be nice to be able to use this package with non-GUI Dart applications and not just Flutter.

Public key generation

Hey, guys
How i can generate key for encode method, based on public key that I take from server.

Thank you !

change in OpenPGP.encrypt() that makes message invalid in other libs

Hello.

I have an application that encodes string data with OpenPGP.encrypt() method. And up until version3.7.0 all other pgp clients that were tried to decrypt messages were doing it OK - no any issues with that.
But after I've updated to versions 3.7.0 other libraries started to report "Not a valid PGP Message" on every encrypted message hat i've sent.

And there is a visible difference in armored ecrypted messages:

OpenPGP.encrypt("hello", pubkey1 + "\n" + pubkey2);

Prior to 3.7.0 it gives:

"-----BEGIN PGP MESSAGE-----
Version: openpgp-mobile

wcBMA/Qt1M8IXRJkAQgAqN5D+8SrZodNECPu5fiTwFE26yjx7pMoNHn1I6cWhC8P
dI1iegjIEAeAsr5RGT8eOj+ExWN71ZK9CU7fvpXnmd9wx0PaGC/PkD2jL/t92pko
riDPbFy1DwFyT/c/Xlx78we97WVgYSAutZ//lt/Q7iNCgxaJmB0KvJbyze9AtRdr
Ng3i1XFGQCAveF7VS4Gk7I8o0IPeLK5jrLqC0Cizj2ykVHtp+CTw53iiFpwZXgcT
hiB/9ZDV20lpuDh19srUul8KS/F039s7mGvLVimgParbk6qRF/lRZDSiGkz9Ee5Z
GL1LeN48OOpHJmjEFUFktio6tNzHl3ow8SJ/MbESH8HATANngF/qmr8TZgEIAK7x
Eyr6NFOrRaCwKSPpuknczP9X0rZ0gwxA3MccAgyREE+KtHED4XckTqUYqN0LXun2
vLkhdvh3xydWTYjQJGfjbhg5l8vhDbqANPIvX8jxxcGaUglCJPtnHhkJjS9kjnQT
G98bIAh/f4I8Vv9jTFoLcTFv8L5w2u2p0sFZrKAn5MOIPkPHihIYol7pZWCvdBbH
kxRzT1faf5++6pzHaAHnZVySz3GfTDlhdKfdRjrbiPy+jv3fASRBuT8EsW5EaCsC
VJKKouCUcNqK+mrVO5DTvWpgz8GVDml3q0gdlqCDtv2S1kaYXtFCHdFRNtGMm+zF
4MXdQR5l4ahIZVV+mlzSNgHtbNMH6zAn24omKMUVurJ5KcSNsZymTNQzV7ddI2fi
9VQPJ+NSOB1P9d/6Bf/6rK5nT4exDw==
=C5On
-----END PGP MESSAGE-----"

But on 3.7.0 it gives:

"-----BEGIN PGP MESSAGE-----
Version: openpgp-mobile

wcBMA/Qt1M8IXRJkAQf+JkKqRvOtBLi5KvONkK9Lpq44CM08K5ifartmwGpBsDWc
e5mlOf1W64wjuiW0g8w5xBwPzrvK8oFm0hzLpt3ombjtj8Bg9yFVlx9Mn5gTnUR9
J+VTo1qQd5u6eMLgMoRdRjLH6CHtUCvTmwyrRTjzZBl7QO6ej9RK5EA/vTYFhaUZ
u3bFQFMoHmajhbCumyrmv3TNKmbVgKizVxMC4aQvGa5Ry7YDO0XS7fnfsSAwFbN5
gKqEMKFLouOG4OpcVHeXNVIlM5gE9vQ7pj/0YWxTaNioAd0HrH3CyMAI7hKyOgeb
TgF1j737OWNKlJXLBs8Yw6s5hjNJQt+XilZPbfDQ6MHATANngF/qmr8TZgEH/iP7
IPPlLm2fAeEQtaPppEQlz3ETlxk6UsW/uUZaddzrbcmb+y8rplZIUw7ZAV8xySgy
q+37nhxwE/tBOrwQasqn1gc6jthzaSKUQwZ2SOJNv70Q0+uxGG5dARPN2EklUGiZ
9rWAI/j8kfHnU9J4xiQFMroomK9LKRUjy/tgifv8cwkbnN+CyWW8wx0uAbcX6k+m
f4ZJvTDYbxihxMkXDLm1xcKfb/o507Uvec0W4BNdrdgQB9GuoRUo/ToVL4bNIy3p
KSsbTuEG0wCfzjRCftq8ePnRXb2RJGpQwWCEptgDW5ZmkwRr9OBl4egUrR8PODPy
4JvzBf470x+CYBA3XFHSNgFLZt6FkSgMdmFj69Ptz1jHP9K1GUNToe7/z6he8ShE
m4Ibw1ojRTMgGauK9TKO0+ptzocdOA==
-----END PGP MESSAGE-----"

I can see this "=C5On" suffix in the first one, which is absent in the second.

Error (Xcode): 21 duplicate symbols for architecture x86_64

When building an application I'm getting the following error:

Launching lib/main_development.dart on Illia’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: DV7K3P4F5L
Xcode build done.                                           92.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2022-03-03 17:14:24.644 xcodebuild[73985:2533026]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-19114/DTDeviceKitBase/DTDKRemoteDeviceData.m:373
    Details:  (null) deviceType from 00008030-0010281E3A68802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7fb7b84c3ca0>
    Method:   -platform
    Thread:   <NSThread: 0x6000009c4040>{number = 7, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2022-03-03 17:14:24.915 xcodebuild[73985:2533024]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-19114/DTDeviceKitBase/DTDKRemoteDeviceData.m:373
    Details:  (null) deviceType from 00008030-0010281E3A68802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7fb7b84c3ca0>
    Method:   -platform
    Thread:   <NSThread: 0x6000008d0a40>{number = 9, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2022-03-03 17:14:25.009 xcodebuild[73985:2533024]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-19114/DTDeviceKitBase/DTDKRemoteDeviceData.m:373
    Details:  (null) deviceType from 00008030-0010281E3A68802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7fb7b84c3ca0>
    Method:   -platform
    Thread:   <NSThread: 0x6000008d0a40>{number = 9, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/xw/1s5t02vd5ds00y_rjccfmq8w0000gp/T/flutter_tools.Cmr6Bm/flutter_ios_build_temp_dirmzeMbd/temporary_xcresult_bundle
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.6.3/ios/Classes/SwiftContactsServicePlugin.swift:230:17: warning: initialization of immutable value 'contactViewController' was never used; consider replacing with assignment to '_' or removing it
                let contactViewController = CNContactViewController.init(forNewContact: nil)
                ~~~~^~~~~~~~~~~~~~~~~~~~~
                _
    remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift:557:13: warning: setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
                UIApplication.shared.statusBarStyle = UIStatusBarStyle(rawValue: previousStatusBarStyle)!
                ^
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Types/URLCredential.swift:14:25: warning: comparing non-optional value of type '[Any]' to 'nil' always returns true
            if certificates != nil {
               ~~~~~~~~~~~~ ^  ~~~
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift:86:25: warning: 'spotlightSuggestion' was deprecated in iOS 10.0: renamed to 'WKDataDetectorTypes.lookupSuggestion'
                    return .spotlightSuggestion
                            ^
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift:86:25: note: use 'WKDataDetectorTypes.lookupSuggestion' instead
                    return .spotlightSuggestion
                            ^~~~~~~~~~~~~~~~~~~
                            WKDataDetectorTypes.lookupSuggestion
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift:121:31: warning: 'spotlightSuggestion' was deprecated in iOS 10.0: renamed to 'WKDataDetectorTypes.lookupSuggestion'
                if type.contains(.spotlightSuggestion) {
                                  ^
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift:121:31: note: use 'WKDataDetectorTypes.lookupSuggestion' instead
                if type.contains(.spotlightSuggestion) {
                                  ^~~~~~~~~~~~~~~~~~~
                                  WKDataDetectorTypes.lookupSuggestion
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Classes/Util.swift:216:21: warning: immutable value 'j' was never used; consider replacing with '_' or removing it
                    for j in ipv6.count...8 {
                        ^
                        _
    remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/amplitude_flutter-3.8.1/ios/Classes/SwiftAmplitudeFlutterPlugin.swift:127:64: warning: 'logRevenue(_:quantity:price:)' is deprecated: Use `logRevenueV2` and `AMPRevenue` instead
                        Amplitude.instance(withName: instanceName).logRevenue(productIdentifier,
                                                                   ^
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/amplitude_flutter-3.8.1/ios/Classes/SwiftAmplitudeFlutterPlugin.swift:134:64: warning: 'logRevenue' is deprecated: Use `logRevenueV2` and `AMPRevenue` instead
                        Amplitude.instance(withName: instanceName).logRevenue(NSNumber(value: amount))
                                                                   ^
    /* com.apple.ibtool.document.warnings */
/Users/illia.s/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.3.2/ios/Storyboards/WebView.storyboard:global: warning: This file is set to build for a version older than the deployment target. Functionality may be limited. [9]
    duplicate symbol '__cgo_panic' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(go.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(go.o)
    duplicate symbol '__cgo_topofstack' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(go.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(go.o)
    duplicate symbol '_crosscall2' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(go.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(go.o)
    duplicate symbol '_xx_cgo_panicmem' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(go.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(go.o)
    duplicate symbol '__cgo_release_context' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000004.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000004.o)
    duplicate symbol '__cgo_sys_thread_start' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000005.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000005.o)
    duplicate symbol '_x_cgo_init' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000005.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000005.o)
    duplicate symbol '_x_cgo_set_context_function' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '__cgo_get_context_function' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '__cgo_try_pthread_create' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '_x_cgo_sys_thread_create' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '_x_cgo_notify_runtime_init_done' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '__cgo_wait_runtime_init_done' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000006.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000006.o)
    duplicate symbol '_x_cgo_unsetenv' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000007.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000007.o)
    duplicate symbol '_x_cgo_setenv' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000007.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000007.o)
    duplicate symbol '_darwin_arm_init_thread_exception_port' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000008.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000008.o)
    duplicate symbol '_darwin_arm_init_mach_exception_handler' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000008.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000008.o)
    duplicate symbol '_x_cgo_callers' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000009.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000009.o)
    duplicate symbol '_x_cgo_thread_start' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000010.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000010.o)
    duplicate symbol '__cgo_yield' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000010.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000010.o)
    duplicate symbol '_crosscall1' in:
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/fast_rsa/ios/librsa_bridge.a(000011.o)
        /Users/illia.s/Apps/Flutter.JetWallet/ios/.symlinks/plugins/openpgp/ios/libopenpgp_bridge.a(000011.o)
    ld: 21 duplicate symbols for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    Result bundle written to path:
    	/var/folders/xw/1s5t02vd5ds00y_rjccfmq8w0000gp/T/flutter_tools.Cmr6Bm/flutter_ios_build_temp_dirmzeMbd/temporary_xcresult_bundle
Could not build the precompiled application for the device.
Error (Xcode): 21 duplicate symbols for architecture arm64

Error launching application on Illia’s iPhone.
Exited (sigterm)

Wrong architecture of libopenpgp_bridge.so on ARM64 device

I'm developing an app on a arm64 device (armbian: Linux x 6.1.10-rockchip64 #trunk.0242 SMP PREEMPT Tue Feb 7 05:24:35 UTC 2023 aarch64 GNU/Linux)

I'm unable to produce a working working executable in both debug and release builds because of libopenpgp_bridge.so being compiled for wrong architecture.

$ file build/linux/arm64/*/bundle/lib/*.so 
build/linux/arm64/debug/bundle/lib/libflutter_linux_gtk.so:   ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a072b72ecc95306735daaad5b47c620b4953f556, stripped
build/linux/arm64/debug/bundle/lib/libopenpgp_bridge.so:      ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=adcb9def550a7eaa9e488621a31e6854ca2e23d6, stripped
build/linux/arm64/debug/bundle/lib/libopenpgp_plugin.so:      ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=16f0668d18c65ce9d4b1fb36d32c90c8bba671a0, with debug_info, not stripped
build/linux/arm64/release/bundle/lib/libapp.so:               ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=8228d9e1c0f9f4ff3c2a23c0dff94fb0, stripped
build/linux/arm64/release/bundle/lib/libflutter_linux_gtk.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=50790af499eb625dd98554b310f0cdd5d3005e38, stripped
build/linux/arm64/release/bundle/lib/libopenpgp_bridge.so:    ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=adcb9def550a7eaa9e488621a31e6854ca2e23d6, stripped
build/linux/arm64/release/bundle/lib/libopenpgp_plugin.so:    ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=def16c5db18326d5eb75304b3874cb53cfaa69ae, not stripped

I guess that it have something to do with ~/.pub-cache/hosted/pub.dev/openpgp-3.5.1/linux/shared/libopenpgp_bridge.so also being x86_64 binary instead of arm64.

Can't decrypt flutter-openpgp encrypted content with bouncycastle.openpgp

Hi!

I'm encrypting content with flutter-openpgp and trying to decrypt it in a java application using bouncycastle openpgp.

Bouncycastle openpgp throws this error:

java.lang.ClassCastException: org.bouncycastle.openpgp.PGPLiteralData cannot be cast to org.bouncycastle.openpgp.PGPCompressedData
java.lang.ClassCastException: org.bouncycastle.openpgp.PGPLiteralData cannot be cast to org.bouncycastle.openpgp.PGPCompressedData

I can decrypt the content using linux cli tools, so the content should be fine. Is there a way to encrypt content with flutter-openpgp so that it becomes PGPCompressedData instead of PGPLiteralData?

Thank you!

FFI error

Dear all,

if I try to execute the demo code in my app, I get an error saying:
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'FutureOr<Uint8List>?' #0 Binding.callAsync.<anonymous closure> (package:openpgp/bridge/binding.dart:49:26)

The code I'm using is:

    var keyPair = await OpenPGP.generate(
        options: Options()
          ..name = 'test'
          ..email = '[email protected]'
          ..passphrase = ''
          ..keyOptions = keyOptions);
    debugPrint(keyPair.publicKey);

The debugger jumps to this line in file ffi_dynamic_library_patch.dart:

Pointer<T> lookup<T extends NativeType>(String symbolName)
      native "Ffi_dl_lookup";

Any idea, what this could be and how I can solve this?

Thanks a lot!

Crash in readPrivateKeys when the input contains both public and private keys

Is it correct that the current version of openpgp, 3.4.0, does not support DSA/ElGamal keys, but RSA keys only?

As openpgp is crashing within the go code in

  • thread #43, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=1, address=0xe0)
    frame #0: 0x00000001049e50cc Runnergithub.com/jerson/openpgp-mobile/openpgp.(*FastOpenPGP).readPrivateKeys + 124 Runnergithub.com/jerson/openpgp-mobile/openpgp.(*FastOpenPGP).readPrivateKeys:
    -> 0x1049e50cc <+124>: ldrb w6, [x6, #0xe0]
    0x1049e50d0 <+128>: cbz x6, 0x1049e50b8 ; <+104>
    0x1049e50d4 <+132>: str x3, [sp, #0x60]
    0x1049e50d8 <+136>: str x5, [sp, #0x78]

(this is on iOS)

when asked to decypt a cryptotext with a DSA/Elgamal key.

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.