ggkitsas / seafile-cryptostick Goto Github PK
View Code? Open in Web Editor NEWSeafile with smart card authentication
Seafile with smart card authentication
In the "sync library" window and others, the order of buttons is confusing. It should be this order: Cancel, OK (from left to right). Even though this seems like an irrelevant bug, it confused several test users which accidentally pressed Cancel instead of OK.
When generating a key-pair for Crypto Stick, user should have the option to create a file backup
Possible formats:
When a new library is created using Crypto Stick, the files that exist in the folder to be synced (and sub-folders) are not sync.
The folder structure is saved correctly to the server.
On the other hand, when a file is edited, is it synced correctly.
Port seafile with Crypto Stick feature to Mac OS.
Needed changes should be at Crypto Stick pcsc driver
Get the value of the retry counter for user/admin pins from the smart card and dislpay to the password dialogs.
Refresh the value every time the user inserts a wrong pin
Create an right click menu option to delete a library through the client application.
Each file of a library is to be hashed and the list of filehashes of the library should be equipped with a timestamp and signed by the public key of the Crypto Stick. This allows to verify if all uploaded files could be retrieved and are integer.
Create an abstraction layer to the smart card drivers. This layer should define the high level operation needed by the client. Also it should abstract the OS's driver usage details.
when importing the backup, i get an error message "incorrect cryptostick". however, the actual import seems to have worked correctly. i can just press OK a second time and get the library resynced as expected.
When creating a new unencrypted library, the creation stops with error "Failed while indexing files"
Seafile should be able to work with GnuPG keyrings.
This includes parsing subkey signatures to determine the type of usage (authentication, encryption, signing) of each subkey and importing them to the device.
Port seafile with Crypto Stick feature to Windows OS.
This task should need modifications to the Crypto Stick pcsc driver
The sharing mechanism should be available from the seafile client
I generated a key. after pressing OK in the "Generate Key Pair" dialog, i got back to the previous window where i create a new library. this confused me and i was wondering if the key generation failed or succeeded. suggestions:
The flow would be like this:
User should have the option to use a password and a cryptostick for protecting libraries.
With this feature, a library can be shared using the password and the user that created it can authenticate herself using either the Crypto Stick or the password.
Sharing option could be used with OpenPGP.
First option is to share the .keys file (and the password that was used to encrypt this file) with all the members of a team. Each member then can import the keys from the file to a device and access the library.
Second option is that the owner of the library asks the public key of each new member and registers them to the server.
The first option has the advantage of simplicity, because only one device is needed to be registered to the server
The second option is more secure because no passwords are transfered using another communication channel (possibly insecure). It also provides the freedom that each user can use each own key pair without having to erase and import keys to her device.
The (key,iv) tuple derived from a library's password, is saved at repo.db (table RepoKeys).
This info is not cleared when there is no need of them.
When a backup is used, the primary device gets forgotten. Only one between these two devices can be registered at the same time.
User should be able to use more than one Crypto Stick to protect a library.
This feature will be usefull for shared libraries, where each user has it's own Crypto Stick
A Security Settings dialog should be present, with a corresponding right click menu entry for the listed libraries. This dialog shold give the user the capability to add and remove Crypto Stick devices.
Use:
if (RAND_bytes(buf, size) != 1)
instead of:
if (!RAND_bytes(buf, size))
because there is an error code -1, that we should take care of
See http://jbp.io/2014/01/16/openssl-rand-api/ (4. Recommendations and patches)
At create-new-repo and download-repo dialog, aside the smart card dropbox menu
Icon to use: the same for refreshing the repo-list
When using a blank Crypto Stick without keys, the device is detected successfully and can be selected to encrypt a library. But later the process fails with "Selected Cryptostick not found. Check if it was accidentially unplugged."
Quick fix Display a message to the user, informing her to initialize the Crypto Stick with keys.
Proper solution: Integrate functionality to generate keys directly within the application.
Currently only 2048-bit RSA key lengths are tested
Libraries that are protected with a smart card should have disabled the password fields on the create and download dialogs.
Also may use a new icon when presented at the library list.
If the smart card is blocked due to many unsuccessful PIN verification tries, the user should be able to unblock the card using the admin password.
Needed functionality:
add a feature to allow changing the default PINs. this would be required for users which have a blank device and don't want to use any other software.
When creating a new encrypted library, the procedure is the following:
This procedure must be changed to:
Replicate:
Select an action that need PIN authentication (either User or Admin).
Type the PIN
Cancel the PIN dialog
Reopen/retrigger the PIN dialog
When a buffer that is responsible for holding sensitive security data such as cryptographic keys or passwords is freed, it's contents should also be wiped out with random data to erase memory residues.
These buffers include:
This is due to change of the schema of clone.db (under /.seafile-data.
Possible fixes:
Seafile client can secure and encrypt libraries using a user password.
The goal is to add functionality to Seafile client, such that a user can secure a library using a Cryptostick.
More specifically:
Some new controls and dialogs will be introduced.
Libraries are encrypted using AES-256. The AES key is referred as secret key and produced randomly. This key is encrypted using a key derived from the user password and saved with the library's metadata. The resulting key is referred as the random key.
Also a magic is produced using the password and the library's id. The purpose of the magic is to
check if the given user password during authentication is correct. This is done by calculating the magic for this password and library and comparing it with the saved magic.
For the decryption procedure, first the magic is checked and, if the check is passed, the random key is decrypted (using the derived key from the password) to obtain the secret key. Then the secret key is given to AES and the decryption takes place.
This feature's goals are:
To add Cryptostick support, we will encrypt the secret key using the smart card's public key and save the produced random key at the server side, within the library's metadata. Also the ID/serial # of the smart card must be saved and linked with the specific random key so during the authentication we can choose the corresponding key to decrypt.
The above require changes to the server. Specifically the server must be able to save and the produced random keys and the smart cards' IDs. Also the client/server communication protocol will need some changes too. The server's development takes place here:
https://github.com/ggkitsas/seahub-cryptostick
Selecting to create a backup key file when generating a key-pair doesn't result in creating a key file
For encrypted libraries, Seafile stores the password or library key at the client system. When starting Seafile it doesn't require the user to enter the library password. This is a security flaw. Instead Seafile should never store the library key/password and ask the user during startup. The same is true for the Crypto Stick integration.
type:security
The salt used with the KDF for producing the secret key of a new library is static.
This means that all libraries have the same salt
Also there is an instance of usage of this KDF when creating session keys for communicating with the server
FIX: Seafile makes exclusive usage of smartcard.
when importing keys to a backup device, there is always the error message "incorrect cryptostick".
See [https://github.com/haiwen/seafile/issues/791]
Serial number of registered Crypto Stick(s) should be saved to the server.
Serial number(s) should be transfered with 'RepoDownloadInfo' data, to the client
Create a dialog for generating and importing keys to a blank cryptostick.
This dialog opens when a blank cryptostick is selected by the user to create a library.
It should also have the option to keep a backup file (p12) of the key pair.
Use .keys as the default file extension for both, exporting and importing keys.
When creating a new library, the description shouldn't be mandatory but optional.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.