Charm: A tool for rapid cryptographic prototyping

Charm is a framework for rapidly prototyping advanced cryptosystems. Based on the Python language, it was designed from the ground up to minimize development time and code complexity while promoting the reuse of components.

Charm uses a hybrid design: performance intensive mathematical operations are implemented in native C modules, while cryptosystems themselves are written in a readable, high-level language. Charm additionally provides a number of new components to facilitate the rapid development of new schemes and protocols.

Features of Charm include:

  • Support for various mathematical settings, including integer rings/fields, bilinear and non-bilinear Elliptic Curve groups.
  • Base crypto library, including symmetric encryption schemes, hash functions, PRNGs.
  • Standard APIs for constructions such as digital signature, encryption, commitments.
  • A “protocol engine” to simplify the process of implementing multi-party protocols.
  • An integrated compiler for interactive and non-interactive ZK proofs.
  • Integrated benchmarking capability.

Charm ships with a library of implemented cryptosystems. This library includes public key encryption schemes, identity-based encryption schemes, attribute-based encryption schemes, digital signatures, privacy-preserving signatures, commitment schemes, zero-knowledge proofs, and interactive protocols such as anonymous credential and oblivious transfer schemes.

To cite Charm, use the following bibtex reference:

  journal={Journal of Cryptographic Engineering},
  title={Charm: a framework for rapidly prototyping cryptosystems},
  keywords={Applied cryptography; Protocols; Software; Privacy},
  author={Akinyele, Joseph A. and Garman, Christina and Miers, Ian 
          and Pagano, Matthew W. and Rushanan, Michael 
          and Green, Matthew and Rubin, Aviel D.},

This work was made possible by NSF grant CNS 1010928 and Grant Number HHS 90TR0003/01.  Its contents are solely the responsibility of the authors and do not necessarily represent the official views of the HHS.


The Charm code repository is split into two branches: the dev branch (for Python 3.x) and the 2.7-devbranch (for Python 2.7).

To check out the dev branch (default):

git clone

To switch to the 2.7-dev branch:

git checkout 2.7-dev

To switch back to the dev branch:

git checkout dev

Frequently Asked Questions

Frequently Asked Questions

Q: What is Charm?

Charm is a framework for rapidly prototyping new cryptographic schemes and protocols.  The design philosophy of Charm is to remove the barriers that make it difficult for researchers and developers to implement their work.  Charm accomplishes this by providing a framework based around a high-level language (Python) and a set of tools that handle many of the difficult aspects of cryptographic development.

Q: Who should use Charm?

This first release of Charm is targeted at cryptographers and computer security researchers.  However we hope that someday in the not-too-distant future Charm will also be useful to open source and commercial software developers.

Q: What’s wrong with existing development approaches?

Many cryptographic libraries are written in C or C++ because these languages are relatively ‘low-level’ and are perceived to offer performance benefits.  This is accurate in some cases.  However, these languages tend to impose barriers that complicate the development of cryptosystems.  Charm is designed from the ground up to facilitate cryptographic development using re-usable components.

Q: Why Python?

Charm is based on the Python programming language, with some performance-critical modules written in C.  Python provides a number of useful features that simplify the development of cryptographic schemes, including loose typing, flexible data structures and operator overloading.  Moreover Python programs are relatively free of clutter.  The language is well supported and can be used in a variety of environments.

Q: Is Charm just a crypto library?

Charm is a framework for developing cryptosystems.  It ships with a library (“toolbox”) of re-usable code, but it also includes infrastructure to assist cryptographic implementers.  These include tools for combining primitives, an interactive protocol engine and a zero-knowledge proof compiler.

Q: Can Charm code be used in applications?

Yes.  Charm schemes can be incorporated into C and C++ programs.  We are currently working to incorporate Charm code into Java programs via the Jython compiler.

4 Important Elements in Designing a Quality Game.

No one can explain exactly what a game is. We only know that game likes a new world with large attraction, interesting images and exciting colors. In the modern game technology, a game designer need to have many faculties, especially, include creation skill and skills of an artist. The process of designing a game is not too complex, but there are some rules which we should know and obey – the elements of game design. Let’s find out those simple rules which create a nice game.

1. Challenge

In order to create attraction of a game, we can not talk about the challenge – this is its core. At the same time, it make a source of inspiration for player with a game, for example, we are happy when we win, conversely, when losing we feel sad. In traditional, win-state is always the final goal, but it is not just challenge. During the game, each obstacle, each puzzle, each adversary defeated is a challenge. We tend to overcome these challenges, from micro-challenges to main challenges and the overall challenge.

a. Games without Challenges?

  • A game which has not challenge will like a toy. That means players can set their own challenges in that game by themselves. It is not bad, because both Minecraft and the Sims are both fantastically popular, although those games have trend to reduce more. Another example, Ben Pitt’s “You are the road” or Daniel Benmergui’s “Storyteller” are online toys, they do not have win-state or lose-state, they are toy of what is possible if you want to go down this path.
  • So, the challenge in a game is very important. A nice game is a game which has challenge.


b. Do Challenges Incorrectly?

  • The game is too easy or too hard, the challenge in that game is bad, called “bad challenge”.A challenge must be fair with players, it means that not only setting the difficulty at a suitable level but also sure that the users can be reasonably expected to complete it.
  • For instance, the card game Solitaire is the most popular computer game of all time because it is simple and has fast time, however, depending on the type of games, 79% of Solitaire’s games are winnableand 21% chance that you could not win. According to characteristic of this game, we can see that “challenges” of Solitaire often feels like luck rather than skill.

2. Choice

Choice will reflect our skill in a game. It also make the challenge is more interesting. Almost all of players expect to make choice which affect on game, include being academic (do you want to be anarcher or a knight) or being split-second decisions in the heat of combat.

Setting choices in a game need to be politic. Since giving the fake choice can make player to feel involved, but with too many artificial choices will make your game badly affected.

a. Gameswithout Choice?

Players could feel bored with a game which has not choice. In other world,they become passive observers in this game. For example, the game of “Snake and Ladders”does not depend on skillbecause it is suitable for children, not adults, although players of all ages can play together happily.

b. Provide Incorrect Choice?

Popular mistakes which people make designing choice mechanics: include:

  • No choice: Reject ability to make choice of players. The interaction will disappear when players use ability such asinvincibility or stunlocks.
  • Choice does not matter: a positive where have the same outcomes, because player’s choice does not affect.
  • One correct choice: The decision-making process is formal only when a choice is very so strong. In a game, player will choose a characters or cards which are strongest to dominate the Meta, such as choosing the best character in a fighting game; or when making a wizard, choosing to be an elf.
  • Uniformed choice:means choices which player make do not explained.When player give choices, they should understand about those choices: why they are making choices? What long-term affects those choices? When a player starts studying the game, they do not know more about the expected outcome of each option available them. So they will be overwhelmed. They will fail to make a choice because of abundance of choices. This is a reason why a good tutorial is so useful.

3. Change

Change is a necessary thing in game design. A game which has change means that has many micro challenges, such as “collect a diamon” or “kill a zombie”. For instance, in Mario, we play 1st level, 2nd level, and 3rd level and so on. We do not repeat one level more and more. That change in all of levels makes the game is more attractive.

a. Gameswithout Changes?

Change makes a game is more interesting. So if a game does not have change, the player will feel bored quickly. Let repeat example for Mario game: in Mario 1, the world is the same; but we can clearly see this in Super Mario Bros.2, the worlds are different. Though each world, this game always have change about position, color, image, as much as environment and monster.

For changing, we could not talk about Puzzle, with basic principle behind the crossword, and changing content as much as the word, Puzzle becomes more plentiful.

b. Do Changes in Wrong Way?

Changing is extremely necessary, but how should we change in order to the game is more interesting? The mobile game Flow Free with over 1,000 levels, almost of players could not complete all those levels because each level has the same the end. That makes users feel bored and they do not want to solve. The result is that game becomes trivial.

Change is very important, but it is a half of game design. We need to explore something which sure the player attend to the game in long time and can not only overcome our game immediately.

4. Chance

The final element of game design is Chance. In a game, player often create new skills and new strategies in order to adapt conditions in initial plan. Chance in game has many types like cards, dice, random number… Chances are created will make player feel more pleasant.

a. Gameswithout Chance?

A game without change likes a question which has the answer. It is not interesting. Chance in a game not only make you complete the objective but also make you brain storm through challenge.

b. Do Chance in Wrong Way?

Game is the direct examination for skills of players, so, it is difficult to create chance which suitable that game. According statistic, players who have low skill like the games which is affected by chance, and conversely, high skill players do not like that.

In addition, player’s choice could depend on chance. When choice becomes unimportant, players will not like that game.


In game design, we combine all 4 elements tobring our vision: game is something to challenge player, players make choice to overcome that challenge, adding chance so that players cannot sure their choice is correct. Choice makes the game’s status to change, so players always estimate their choice. When players make choice, result of game is win or lose.

This is important question. There are many people who know wrongly about game, include game production. So, before designing a game, let think about what you’re aiming for. Game design is very complex, you need to your story, your music, your image, your sound and so on.




Things to know if you want to become a video game programmer.

Video games have long been very familiar to us. From adults to children, anyone can enjoy video games. In it there are people who are so interested in games, they are looking for ways to become a game programmer. Another reason is the profitability of the game for you, with a popular game that can turn you into a millionaire.

1. Information:

Information is very important. If you are looking to be a game programmer, first find out information about this field to see what its characteristics are. You can get information by asking your friends, learning on game programming sites, attending sharing sessions on this issue … Once you have the information and understanding about what you want to do, you will find a lot easier.

2. Understand your ability:

At present, the gaming industry has grown tremendously. It includes a lot of content from pictures, sound, animation, game features … So if you want to be a game developer, you have to know what you are going to learn.

Video games include a lot of things, from the writing of the game’s source code and features, to creating 3D images of the characters, creating effects, movement in the game, etc.

My advice to you is to determine your ability, to understand the skills you can learn and to develop them, which is the first thing you want to become a game developer.

3. Joining training courses:

Training courses on game programming are also places where you can learn many useful things. You only need to spend some money to study these short courses. Because when joining the course, in addition to learning the theory you will also be practicing, this will be very interesting and it will bring you valuable experience. If you are looking for a course on gaming, check out schools like DeVry University or UAT Online Game Degree.

4. Understand the tools for making games:

Do not think that game programming is all you have to do yourself. There are many tools that can assist a lot of game developers. If you know the tools and use them effectively, the results will be great and save you time. For example “Radiant”, “Cry-Engine” or “Source” and “Unreal-Engine“… you can use these tools to create maps, levels, items in the game as weapons, armor or even you can create a beautiful character as a real person if you are qualified. All these tools have documentation on the internet, use Google to refer to them.

5. Game programming language:

Programming languages are fundamental and require you to understand them if you want to be a game developer. Make sure you are good at C ++, as this is a common and widely used language in the game. If you are just a beginner, try DarkBASIC first, but you can also take a look at the Microsoft Visual Basic course, which is also a very interesting language.

6. “Problem solving” attitude:

Unlike other areas, if you want to become a game developer, you need to be patient and calm. There will be many cases that arise and can not be resolved immediately (mostly about difficult bugs). In order to solve these cases, you need to persevere and slowly find ways to fix it.

7. Practice:

To be a good game programmer, you can not just learn the theory. Practice is a very important element in this area. You need to regularly code games, regularly apply the tools you know. Of course, the more you practice, the more bugs you will find. From then on you will have to fix these bugs, and you will become more professional and enhance your abilities.

8. Join game programming groups:

Join the game programming group, you will experience teamwork. This is also very important, because when you really want to follow this path, you will not be able to do everything by yourself. Work in groups, divide work and learn the experiences and skills of others. This will help you improve your ability to a lot, or at least it will also give you a better understanding of the field of game programming.

9. Learn from the programmers around you:

Learning the right place, the right person is also the way you both find what you want and save time. Try to look around your area for some famous game developers or have had a long experience and ask them to tell you what you are wondering.

10. Use the Google:

Google is always a good choice in many different areas, including the field of game programming. You can find anything from documentation to instructional videos. However, referring from reputable sites will be better!